From 27ebb97d0a51a3198f2c95cbdccd6f56274c19ee Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 May 2022 15:45:10 +0200 Subject: 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. --- tests/lang/parse-fail-eof-in-string.nix | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/lang/parse-fail-eof-in-string.nix (limited to 'tests/lang/parse-fail-eof-in-string.nix') diff --git a/tests/lang/parse-fail-eof-in-string.nix b/tests/lang/parse-fail-eof-in-string.nix new file mode 100644 index 000000000..19775d2ec --- /dev/null +++ b/tests/lang/parse-fail-eof-in-string.nix @@ -0,0 +1,3 @@ +# https://github.com/NixOS/nix/issues/6562 +# Note that this file must not end with a newline. +a 1"$ \ No newline at end of file -- cgit v1.2.3