From b82c2241b7e41b93853638bdd8fd899d358f8c60 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 8 May 2014 19:41:27 +0300 Subject: [PATCH] get parameter lists to work again (no more ifs as function arguments:-) --- lib/parser/composed.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/parser/composed.rb b/lib/parser/composed.rb index d2ed39e3..a69eb5c9 100644 --- a/lib/parser/composed.rb +++ b/lib/parser/composed.rb @@ -19,7 +19,8 @@ module Parser rule(:argument_list) { left_parenthesis >> - ((expression.as(:argument) >> (comma >> expression.as(:argument)).repeat(0)).repeat(0,1)).as(:argument_list) >> + ( (simple_expression.as(:argument) >> + (comma >> simple_expression.as(:argument)).repeat(0)).repeat(0,1)).as(:argument_list) >> right_parenthesis } @@ -27,7 +28,9 @@ module Parser rule(:assignment) { name.as(:asignee) >> equal_sign >> expression.as(:asigned) } #| (name >> space? >> equal_sign.absent?) - rule(:expression) { conditional | function_call | integer | string } + + rule(:simple_expression) { function_call | integer | string | name } + rule(:expression) { conditional | simple_expression } def delimited_expressions( delimit ) ( (delimit.absent? >> (assignment | expression)).repeat(1)).as(:expressions) >> delimit