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.
This commit is contained in:
committed by
Henry Zhu
parent
99fbcefa65
commit
d3af158ba5
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:6)"
|
||||
"throws": "Unexpected token, expected ; (1:6)"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:6)"
|
||||
"throws": "Unexpected token, expected ; (1:6)"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:2)"
|
||||
"throws": "Unexpected token, expected ; (1:2)"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:2)"
|
||||
"throws": "Unexpected token, expected ; (1:2)"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:2)"
|
||||
"throws": "Unexpected token, expected ; (1:2)"
|
||||
}
|
||||
Reference in New Issue
Block a user