Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up functioncall parser definition.
  • Loading branch information
Twisol committed Feb 21, 2011
1 parent 17ef419 commit 4fc7642
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/lupin/parser/parser.citrus
Expand Up @@ -148,22 +148,18 @@ grammar Lupin::Parser::Lua

rule functioncall
( var:value_expr
args:(WS? args)+
args:( (WS? '(' WS? explist WS? ')') { explist.value }
| (WS? '(' WS? ')') { [] }
| (WS? table) { [table] }
| (WS? string) { [string] }
)+
) {
f = var.value
args.matches.each {|a| f = Lupin::AST::FunctionCall.new(f, a.value)}
f
}
end

rule args
( ('(' WS? explist WS? ')') { explist.value }
| ('(' WS? ')') { [] }
| (table) { [table] }
| (string) { [string] }
)
end

rule variable
(identifier)
end
Expand Down

0 comments on commit 4fc7642

Please sign in to comment.