may call with r_value

This commit is contained in:
Torsten Ruger 2015-10-09 12:47:03 +03:00
parent 308c0efc05
commit 85adfa7107
2 changed files with 5 additions and 5 deletions

View File

@ -2,17 +2,19 @@ module Parser
module CallSite
include Parslet
rule(:field_access) { name.as(:receiver) >> str(".") >> name.as(:field) }
rule(:r_value) { call_site | field_access | basic_type }
rule(:argument_list) {
left_parenthesis >>
( (basic_type.as(:argument) >>
(comma >> basic_type.as(:argument)).repeat(0)).repeat(0,1)).as(:argument_list) >>
(comma >> r_value.as(:argument)).repeat(0)).repeat(0,1)).as(:argument_list) >>
right_parenthesis
}
rule(:call_site) { (basic_type.as(:receiver) >> str(".")).maybe >> #possibly qualified
name.as(:call_site) >> argument_list >> comment.maybe}
rule(:field_access) { name.as(:receiver) >> str(".") >> name.as(:field) }
end
end

View File

@ -2,8 +2,6 @@ module Parser
module Expression
include Parslet
rule(:r_value) { call_site | field_access |basic_type }
rule(:expression) { (simple_return | while_do | small_conditional | conditional |
operator_expression | call_site | class_field | field |
hash_constant | array_constant) }