zaach / jison

Bison in JavaScript.
http://jison.org
4.35k stars 448 forks source link

Documentation out of date / incorrect #265

Open chbrown opened 9 years ago

chbrown commented 9 years ago

There's an example in the documentation, right below the paragraph that reads:

Actions that span multiple lines should be surrounded by braces:

But the braces shown are %{ and %} braces. Actually, Jison expects plain { and } braces, and throws an error if you use the percent-prefixed kind:

case 3:%{
       ^
SyntaxError: Unexpected token %

The braces in that and the following example should be replaced by normal { / } braces.

nolanlawson commented 9 years ago

The gh-pages branch seems to be quite far behind the master branch. I also noticed a dead link that appears to have been fixed recently (link to the "deviations from flex/bison" in the documentation).

If we update the docs and then update the gh-pages branch, though, then that ought to be good.

nolanlawson commented 9 years ago

I can confirm that, with the latest version of Jison, the %{ }% format does not work, but the { } format does. With Jison 0.4.13 (which I assume the site is using), both formats are accepted. (Using the "ZOMG" example.)

It feels like this is a bug in Jison rather than a bug in the docs. Ideally both formats should be supported, at least for backwards compat, no?