zaach/jison — pull request #146 by GerHobbelt (2013-02-16 01:44:30+00:00)
Title: Pullreq 6 - lexer.parserError() function picks up the one set for the grammar instead of having a mind of its own

quick manual extract of these: (basically, it means the lexer will now correctly pick up your own parseError() override and otherwise use the default one provided by the PARSER instead of having a mind of its own entirely)

SHA-1: 4c63ca6ba17bfe9dd7ce3bb82395abde63f33479

* - generated code now includes the lexer methods' descriptions for improved readability of the generated code.

- fixes the prototype bug in the parseError reset code: this fix is browser-independent.

SHA-1: e7435a690794dedf0c356bd09ce64d8aa9165b34

* attempt at fixing the prototype bug in the parseError reset logic -- http://javascriptweblog.wordpress.com/2010/06/07/understanding-javascript-prototypes/

SHA-1: 7b0e636880ce3204007dd97ec0f99beed3c198b8

* make sure the parseError member function is reset to the default once a previous run of the same instance has temporarily overridden the parseError handler via the parser.yy.parseError override.

sample code (shortened):
parser.yy.parseError = function local_override() { ... };
parser.parse(input_a);
// the next run should use the default error handler again:
parser.yy.parseError = null;
parser.parse(input_b);