diff --git a/lib/parser/call_site.rb b/lib/parser/call_site.rb index df7aeef..b1c3f42 100644 --- a/lib/parser/call_site.rb +++ b/lib/parser/call_site.rb @@ -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 diff --git a/lib/parser/expression.rb b/lib/parser/expression.rb index 2ab0f48..a274407 100644 --- a/lib/parser/expression.rb +++ b/lib/parser/expression.rb @@ -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) }