forked from lix-project/lix
Merge pull request #6570 from edolstra/eof-in-string
Handle EOFs in string literals correctly
This commit is contained in:
commit
762fa2b2ff
|
@ -198,7 +198,7 @@ or { return OR_KW; }
|
||||||
(...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
|
(...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
|
||||||
This is technically invalid, but we leave the problem to the
|
This is technically invalid, but we leave the problem to the
|
||||||
parser who fails with exact location. */
|
parser who fails with exact location. */
|
||||||
return STR;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
\'\'(\ *\n)? { PUSH_STATE(IND_STRING); return IND_STRING_OPEN; }
|
\'\'(\ *\n)? { PUSH_STATE(IND_STRING); return IND_STRING_OPEN; }
|
||||||
|
|
3
tests/lang/parse-fail-eof-in-string.nix
Normal file
3
tests/lang/parse-fail-eof-in-string.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# https://github.com/NixOS/nix/issues/6562
|
||||||
|
# Note that this file must not end with a newline.
|
||||||
|
a 1"$
|
Loading…
Reference in a new issue