Error handling: Use the new |error| function in PEG.js's grammar itself

Implements part of #198.
redux
David Majda 11 years ago
parent 5460a881af
commit f8b5e04bba

@ -267,9 +267,10 @@ class "character class"
classCharacterRange
= begin:classCharacter "-" end:classCharacter {
if (begin.data.charCodeAt(0) > end.data.charCodeAt(0)) {
throw new this.SyntaxError(
error(
"Invalid character range: " + begin.rawText + "-" + end.rawText + "."
);
return;
}
return {

Loading…
Cancel
Save