perf(expression): define `TokenType.STRING` as "string literal" for clearer errors
This commit is contained in:
parent
540ede3439
commit
dd57196953
|
@ -51,7 +51,7 @@ class TokenType(enum.Enum):
|
|||
IDENT = "identifier"
|
||||
EOF = "end of input"
|
||||
EQUAL = "="
|
||||
STRING = "str"
|
||||
STRING = "string literal"
|
||||
COMMA = ","
|
||||
|
||||
|
||||
|
|
|
@ -228,6 +228,7 @@ def test_invalid_idents(ident: str) -> None:
|
|||
r'escaping with "\\" not supported in marker expression',
|
||||
),
|
||||
("mark(empty_list=[])", r'unexpected character/s "\[\]"'),
|
||||
("'str'", "expected not OR left parenthesis OR identifier; got string literal"),
|
||||
),
|
||||
)
|
||||
def test_invalid_kwarg_name_or_value( # TODO: move to `test_syntax_errors` ?
|
||||
|
|
Loading…
Reference in New Issue