rubyx/lib/parser/function_call.rb

17 lines
403 B
Ruby
Raw Normal View History

2014-05-10 10:14:34 +02:00
module Parser
module FunctionCall
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(:function_call) { name.as(:function_call) >> argument_list }
end
end