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:
Moti Zilberman
2016-10-14 23:10:09 +03:00
committed by Henry Zhu
parent 99fbcefa65
commit d3af158ba5
36 changed files with 45 additions and 41 deletions

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:6)"
"throws": "Unexpected token, expected ; (1:6)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:6)"
"throws": "Unexpected token, expected ; (1:6)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:2)"
"throws": "Unexpected token, expected ; (1:2)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:2)"
"throws": "Unexpected token, expected ; (1:2)"
}

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:2)"
"throws": "Unexpected token, expected ; (1:2)"
}