GerHobbelt / jison

bison / YACC / LEX in JavaScript (LALR(1), SLR(1), etc. lexer/parser generator)
https://gerhobbelt.github.io/jison/
MIT License
118 stars 20 forks source link

Using "?." and "??" JS operators in action code blocks ? #63

Open lowlighter opened 3 years ago

lowlighter commented 3 years ago

Hi!

This is more a question rather a bug, is the ES version used by rules execution capped ?

I'm trying to use both optional chaining ?. and nullish coalescing operator ?? but I'm getting errors:

test
  : DEBUG                         -> yy.test?.hello ?? null //Tried with { return yy.test?.hello ?? null } too
  ;
error: Uncaught (in promise) Error: Could not parse jison grammar
Error:
production rule action code block does not compile: Line 45: Unexpected token .

  Erroneous area:
45:   : DEBUG                         -> yy.test?.hello ?? null
^^....................................^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks for your work 🙂