Skip to content

Commit d73f2c6

Browse files
authored
Fix some numeric parsing related issues (#232)
1 parent d6d88e0 commit d73f2c6

File tree

14 files changed

+271
-2049
lines changed

14 files changed

+271
-2049
lines changed

src/Esprima/JavascriptParser.cs

Lines changed: 71 additions & 65 deletions
Large diffs are not rendered by default.

src/Esprima/Messages.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
public static class Messages
55
{
66
public const string AsyncFunctionInSingleStatementContext = "Async functions can only be declared at the top level or inside a block.";
7-
public const string BadImportCallArity = "Unexpected token";
87
public const string BadGetterArity = "Getter must not have any formal parameters";
98
public const string BadSetterArity = "Setter must have exactly one formal parameter";
109
public const string BadSetterRestParameter = "Setter function argument must not be a rest parameter";
@@ -40,32 +39,35 @@ public static class Messages
4039
public const string MultipleDefaultsInSwitch = "More than one default clause in switch statement";
4140
public const string NewlineAfterThrow = "Illegal newline after throw";
4241
public const string NoAsAfterImportNamespace = "Unexpected token";
43-
public const string NoCatchOrFinally = "Missing catch or finally after try";
44-
public const string NumericSeperatorOneUnderscore = "Numeric separator must be exactly one underscore";
45-
public const string NumericSeperatorNotAllowedHere = "Numeric separator is not allowed here";
42+
public const string NoCatchOrFinally = "Missing catch or finally after try";
43+
public const string NumericSeparatorAfterLeadingZero = "Numeric separator can not be used after leading 0";
44+
public const string NumericSeparatorNotAllowedHere = "Numeric separator is not allowed here";
45+
public const string NumericSeparatorOneUnderscore = "Numeric separator must be exactly one underscore";
4646
public const string ParameterAfterRestParameter = "Rest parameter must be last formal parameter";
4747
public const string PropertyAfterRestProperty = "Unexpected token";
4848
public const string Redeclaration = "{0} \"{1}\" has already been declared";
49-
public const string RegexLoneQuantifierBrackets = "Invalid regular expression: Lone quantifier brackets";
5049
public const string RegexIncompleteQuantifier = "Invalid regular expression: Incomplete quantifier";
51-
public const string RegexUnterminatedGroup = "Invalid regular expression: Unterminated group";
52-
public const string RegexUnterminatedCharacterClass = "Invalid regular expression: Unterminated character class";
50+
public const string RegexLoneQuantifierBrackets = "Invalid regular expression: Lone quantifier brackets";
5351
public const string RegexUnmatchedOpenParen = "Invalid regular expression: Unmatched ')'";
52+
public const string RegexUnterminatedCharacterClass = "Invalid regular expression: Unterminated character class";
53+
public const string RegexUnterminatedGroup = "Invalid regular expression: Unterminated group";
5454
public const string StaticPrototype = "Classes may not have static property named prototype";
5555
public const string StrictCatchVariable = "Catch variable may not be eval or arguments in strict mode";
56+
public const string StrictDecimalWithLeadingZero = "Decimals with leading zeros are not allowed in strict mode.";
5657
public const string StrictDelete = "Delete of an unqualified identifier in strict mode.";
5758
public const string StrictFunction = "In strict mode code, functions can only be declared at top level or inside a block";
5859
public const string StrictFunctionName = "Function name may not be eval or arguments in strict mode";
5960
public const string StrictLHSAssignment = "Assignment to eval or arguments is not allowed in strict mode";
6061
public const string StrictLHSPostfix = "Postfix increment/decrement may not have eval or arguments operand in strict mode";
6162
public const string StrictLHSPrefix = "Prefix increment/decrement may not have eval or arguments operand in strict mode";
6263
public const string StrictModeWith = "Strict mode code may not include a with statement";
64+
public const string StrictOctalEscape = "Octal escape sequences are not allowed in strict mode.";
6365
public const string StrictOctalLiteral = "Octal literals are not allowed in strict mode.";
6466
public const string StrictParamName = "Parameter name eval or arguments is not allowed in strict mode";
6567
public const string StrictReservedWord = "Use of future reserved word in strict mode";
6668
public const string StrictVarName = "Variable name may not be eval or arguments in strict mode";
67-
public const string TemplateOctalLiteral = "Octal literals are not allowed in template strings.";
6869
public const string TemplateEscape89 = "\\8 and \\9 are not allowed in template strings.";
70+
public const string TemplateOctalLiteral = "Octal literals are not allowed in template strings.";
6971
public const string UnexpectedEOS = "Unexpected end of input";
7072
public const string UnexpectedIdentifier = "Unexpected identifier";
7173
public const string UnexpectedNumber = "Unexpected number";

0 commit comments

Comments
 (0)