Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Parse error handling #107

Merged
merged 1 commit into from

2 participants

pechkin Zach Carter
pechkin

When error recovery is not used, removeErrorRecovery also deleted parse error handling. I've fixed that.

Zach Carter zaach merged commit 95cf157 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/jison.js
2  lib/jison.js
View
@@ -958,7 +958,7 @@ function removeErrorRecovery (fn) {
var ast = Reflect.parse(parseFn);
var labeled = JSONSelect.match(':has(:root > .label > .name:val("_handle_error"))', ast);
- labeled[0].body.consequent.body = [labeled[0].body.consequent.body[0]];
+ labeled[0].body.consequent.body = [labeled[0].body.consequent.body[0], labeled[0].body.consequent.body[1]];
return Reflect.stringify(ast).replace(/_handle_error:\s?/,"").replace(/\\\\n/g,"\\n");
} catch (e) {
Something went wrong with that request. Please try again.