rubyx/lib/parser/call_site.rb

17 lines
451 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) { name.as(:call_site) >> argument_list >> comment.maybe}
2014-05-10 10:14:34 +02:00
end
end