diff --git a/src/parser.pegjs b/src/parser.pegjs index e5d20e1..a864e03 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -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 {