mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
Handle EOFs in string literals correctly
We can't return a STR token without setting a valid StringToken, otherwise the parser will crash. Fixes #6562.
This commit is contained in:
parent
d8398d33c9
commit
27ebb97d0a
2 changed files with 4 additions and 1 deletions
|
@ -198,7 +198,7 @@ or { return OR_KW; }
|
|||
(...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
|
||||
This is technically invalid, but we leave the problem to the
|
||||
parser who fails with exact location. */
|
||||
return STR;
|
||||
return EOF;
|
||||
}
|
||||
|
||||
\'\'(\ *\n)? { PUSH_STATE(IND_STRING); return IND_STRING_OPEN; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue