undefined number of arguments
leopoldhub opened this issue · 0 comments
leopoldhub commented
Hi, I just recently discovered Jacob and the world of lexers/parsers so I don't know many about them.
I have a parser that allows me to parse a function call that looks like that:
exec myfunc(myvar)
exec myfunc("mytext")
Expression = 'DEFINED' 'ID' 'LBRACE' ('ID'|'MESSAGE') 'RBRACE' function(defined, id, _){console.log(defined, id, [...arguments].slice(3, -1));}
however, this parser only allow me to have one argument. I tried using regex to allow more but got rejected by the compiler.
Is it possible? Is there another way I didn't think of?