-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast: change ident token string (#6435)
This commit changes the string representation of the ident token from 'ident' to 'identifier' as this shows up in error messages and should be a bit friendlier for users. Signed-off-by: Torin Sandall <[email protected]>
- Loading branch information
Showing
4 changed files
with
28 additions
and
28 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
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 |
---|---|---|
|
@@ -752,13 +752,13 @@ func TestSomeDeclExpr(t *testing.T) { | |
p[x] { | ||
some x in {"foo": "bar"} | ||
}`, | ||
"unexpected ident token: expected \\n or ; or } (hint: `import future.keywords.in` for `some x in xs` expressions)") | ||
"unexpected identifier token: expected \\n or ; or } (hint: `import future.keywords.in` for `some x in xs` expressions)") | ||
|
||
assertParseErrorContains(t, "some x, y in ... usage is hinted properly", ` | ||
p[y] = x { | ||
some x, y in {"foo": "bar"} | ||
}`, | ||
"unexpected ident token: expected \\n or ; or } (hint: `import future.keywords.in` for `some x in xs` expressions)") | ||
"unexpected identifier token: expected \\n or ; or } (hint: `import future.keywords.in` for `some x in xs` expressions)") | ||
|
||
assertParseRule(t, "whitespace terminated", ` | ||
|
@@ -848,13 +848,13 @@ func TestEvery(t *testing.T) { | |
p { | ||
every x, y in {"foo": "bar"} { is_string(x); is_string(y) } | ||
}`, | ||
"unexpected ident token: expected \\n or ; or } (hint: `import future.keywords.every` for `every x in xs { ... }` expressions)") | ||
"unexpected identifier token: expected \\n or ; or } (hint: `import future.keywords.every` for `every x in xs { ... }` expressions)") | ||
|
||
assertParseErrorContains(t, "not every 'every' gets a hint", ` | ||
p { | ||
every x | ||
}`, | ||
"unexpected ident token: expected \\n or ; or }\n\tevery x\n", // this asserts that the tail of the error message doesn't contain a hint | ||
"unexpected identifier token: expected \\n or ; or }\n\tevery x\n", // this asserts that the tail of the error message doesn't contain a hint | ||
) | ||
|
||
assertParseErrorContains(t, "invalid domain (internal.member_2)", "every internal.member_2()", "illegal domain", opts) | ||
|
@@ -5194,7 +5194,7 @@ p { input = "str" }`, | |
# - Tyrell Corp. | ||
# related_resources: | ||
# - https://example.com | ||
# - | ||
# - | ||
# ref: http://john:[email protected]/mi?foo=bar#baz | ||
# description: foo bar | ||
# authors: | ||
|
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