rubyx/lib/parser/call_site.rb

18 lines
553 B
Ruby
Raw Normal View History

2014-05-10 10:14:34 +02:00
module Parser
module CallSite
2014-05-10 10:14:34 +02:00
include Parslet
rule(:argument_list) {
left_parenthesis >>
( ((operator_expression|value_expression).as(:argument) >> space? >>
(comma >> space? >> (operator_expression|value_expression).as(:argument)).repeat(0)).repeat(0,1)).as(:argument_list) >>
2014-05-10 10:14:34 +02:00
space? >> right_parenthesis
}
rule(:call_site) { ((module_name|name).as(:receiver) >> str(".")).maybe >> #possibly qualified
name.as(:call_site) >> argument_list >> comment.maybe}
2014-05-10 10:14:34 +02:00
end
end