rubyx/lib/parser/call_site.rb

17 lines
391 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 >>
( (value_expression.as(:argument) >> space? >>
(comma >> space? >> 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 }
2014-05-10 10:14:34 +02:00
end
end