restrict root_body a bit, but add to function

This commit is contained in:
Torsten Ruger 2015-09-20 14:25:06 +03:00
parent ea6472c28f
commit f51563e99b
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,8 @@ module Parser
rule(:value_expression) { call_site | field_access |basic_type } rule(:value_expression) { call_site | field_access |basic_type }
rule(:expression) { (simple_return | while_do | small_conditional | conditional | operator_expression | call_site ) } rule(:expression) { (simple_return | while_do | small_conditional | conditional |
operator_expression | call_site | field | hash_constant | array_constant) }
def delimited_expressions( delimit ) def delimited_expressions( delimit )
( (delimit.absent? >> expression).repeat(1)).as(:expressions) >> delimit ( (delimit.absent? >> expression).repeat(1)).as(:expressions) >> delimit

View File

@ -32,8 +32,7 @@ module Parser
include ModuleDef include ModuleDef
rule(:root_body) {(module_definition | class_definition | function_definition | rule(:root_body) {(module_definition | class_definition | function_definition |
expression | operator_expression | call_site | field_access | expression | operator_expression | call_site )}
basic_type | hash_constant | array_constant )}
rule(:root) { root_body.repeat.as(:expression_list) } rule(:root) { root_body.repeat.as(:expression_list) }
end end
end end