mozilla-spidermonkey / jsparagus

Experimental JS parser-generator project.
Other
439 stars 20 forks source link

Expand ASI using the Parse Table. #626

Open nbp opened 4 years ago

nbp commented 4 years ago

ASI is quite complex as it relates to "offensive tokens" and "restricted tokens", and it would verbose and complex to convert these to grammar rules.

These changes aim at fixing #623 by expanding the ASI rules, such that lower_reduce_action can reason about the fact that ASI move the current failing token to the replay list before reducing an ErrorSymbol.

By adding these rules to the parse table, we would be able of making optimization which would be crossing the presence of CheckNotOnNewLine (renamed to CheckLineTerminator), which would imply adding arguments to states which have a CheckLineTerminator as an out-going edges, and thus should be able to avoid usage of the replay list completely.

(This is a draft, as the generate file phase takes ~10 minutes)