Fix handling of escaped chars in strings
This commit is contained in:
parent
ac53999dee
commit
4fb4e2960d
|
@ -306,3 +306,16 @@ a+=(foo "bar" $(baz))
|
||||||
(word)
|
(word)
|
||||||
(string)
|
(string)
|
||||||
(command_substitution (command (command_name (word)))))))
|
(command_substitution (command (command_name (word)))))))
|
||||||
|
|
||||||
|
==============================
|
||||||
|
Escaped characters in strings
|
||||||
|
==============================
|
||||||
|
|
||||||
|
echo -ne "\033k$1\033\\" > /dev/stderr
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
(program
|
||||||
|
(redirected_statement
|
||||||
|
(command (command_name (word)) (word) (string (simple_expansion (variable_name))))
|
||||||
|
(file_redirect (word))))
|
||||||
|
|
|
@ -425,7 +425,7 @@ module.exports = grammar({
|
||||||
'"'
|
'"'
|
||||||
),
|
),
|
||||||
|
|
||||||
_string_content: $ => token(prec(-1, /([^"`$]|\\.)+/)),
|
_string_content: $ => token(prec(-1, /([^"`$\\]|\\(.|\n))+/)),
|
||||||
|
|
||||||
array: $ => seq(
|
array: $ => seq(
|
||||||
'(',
|
'(',
|
||||||
|
|
Loading…
Reference in New Issue