This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Annotate more errors with expected token (#172)
Expanding on #150, this allows `unexpected()` to accept the expected token type instead of a message string. This overload is then used in a couple more places (that independently implement a logic similar to `expect()`'s) to construct an `Unexpected token, expected FOO` message.
- Loading branch information
Showing
36 changed files
with
45 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:2)" | ||
"throws": "Unexpected token, expected ; (1:2)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:2)" | ||
"throws": "Unexpected token, expected ; (1:2)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:2)" | ||
"throws": "Unexpected token, expected ; (1:2)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:8)" | ||
"throws": "Unexpected token, expected ; (1:8)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (2:4)" | ||
"throws": "Unexpected token, expected ; (2:4)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (2:6)" | ||
"throws": "Unexpected token, expected ; (2:6)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:21)" | ||
"throws": "Unexpected token, expected ; (1:21)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (2:4)" | ||
"throws": "Unexpected token, expected ; (2:4)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:14)" | ||
"throws": "Unexpected token, expected ; (1:14)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:30)" | ||
"throws": "Unexpected token, expected ; (1:30)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/es2015-export-declaration/invalid-export-default/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:20)" | ||
"throws": "Unexpected token, expected ; (1:20)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/es2015-yield/invalid-yield-expression/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:20)" | ||
"throws": "Unexpected token, expected ; (1:20)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/es2015-yield/invalid-yield-generator-member-expression/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:28)" | ||
"throws": "Unexpected token, expected ; (1:28)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0015/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0020/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0021/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0025/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0026/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0028/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:3)" | ||
"throws": "Unexpected token, expected ; (1:3)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0071/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0072/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:6)" | ||
"throws": "Unexpected token, expected ; (1:6)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0115/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:2)" | ||
"throws": "Unexpected token, expected ; (1:2)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/invalid-syntax/migrated_0257/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (1:16)" | ||
"throws": "Unexpected token, expected ; (1:16)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/experimental/class-properties/asi-failure-computed/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"throws": "Unexpected token (3:9)", | ||
"throws": "Unexpected token, expected ; (3:9)", | ||
"plugins": ["classProperties"] | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/experimental/class-properties/asi-failure-generator/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"throws": "Unexpected token (3:8)", | ||
"throws": "Unexpected token, expected ; (3:8)", | ||
"plugins": ["classProperties"] | ||
} |