Closed danbornside closed 6 years ago
the ''\
sequence causes nix to process escape sequences; in particular, the sequence does not end the nix string. this patch makes the syntax hilighter agree with the stringyness when strings do contain those escape sequences.
[dbornside@bornside vim-nix]$ for x in a b c d ; do echo "== $x ==" ; cat ${x}.nix ; echo "----" ; nix eval --raw -f ${x}.nix '' | hexdump -C ; done
== a ==
''\
''
----
00000000 5c 0a |\.|
00000002
== b ==
''\t
''
----
00000000 5c 74 0a |\t.|
00000003
== c ==
''''\t
''
----
00000000 09 0a |..|
00000002
== d ==
''''a
''
----
error: syntax error, unexpected $end, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /home/dbornside/src/contrib/vim-nix/d.nix:2:1
[dbornside@bornside vim-nix]$
Oh! ''\
not \\
, I totally misinterpreted this.
inline heredoc style makefile breaks string highlighting; this fix adds the
\
in interpolated strings