Pullreq 6 - lexer.parserError() function picks up the one set for the grammar instead of having a mind of its own #146

Merged
merged 2 commits into from Apr 17, 2013

Projects

None yet

2 participants

@GerHobbelt
Contributor

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: 4c63ca6

    • 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: e7435a6

SHA-1: 7b0e636

  • 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);

GerHobbelt added some commits Feb 16, 2013
@GerHobbelt GerHobbelt gitignore: editor bak files 17f8d26
@GerHobbelt GerHobbelt quick manual extract of these: (basically, it means the lexer will no…
…w 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: 4c63ca6

* - 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: e7435a6

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

SHA-1: 7b0e636

* 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);
5928197
Owner
zaach commented Feb 16, 2013

Nice. We should add a test case for the parseError reset issue.

@zaach zaach merged commit c54f5e4 into zaach:master Apr 17, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment