restrict root_body a bit, but add to function
This commit is contained in:
parent
ea6472c28f
commit
f51563e99b
@ -4,7 +4,8 @@ module Parser
|
||||
|
||||
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 )
|
||||
( (delimit.absent? >> expression).repeat(1)).as(:expressions) >> delimit
|
||||
|
@ -32,8 +32,7 @@ module Parser
|
||||
include ModuleDef
|
||||
|
||||
rule(:root_body) {(module_definition | class_definition | function_definition |
|
||||
expression | operator_expression | call_site | field_access |
|
||||
basic_type | hash_constant | array_constant )}
|
||||
expression | operator_expression | call_site )}
|
||||
rule(:root) { root_body.repeat.as(:expression_list) }
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user