allow space after backslash to act as line continuation (#49)
This commit is contained in:
parent
ecea7ac2c9
commit
40eceeff30
|
@ -405,7 +405,7 @@ module.exports = grammar({
|
|||
)
|
||||
),
|
||||
|
||||
line_continuation: ($) => "\\\n",
|
||||
line_continuation: ($) => /\\[ \t]*\n/,
|
||||
required_line_continuation: ($) => "\\\n",
|
||||
|
||||
_comment_line: ($) => seq(alias($._anon_comment, $.comment), "\n"),
|
||||
|
|
4
src/grammar.json
generated
4
src/grammar.json
generated
|
@ -1670,8 +1670,8 @@
|
|||
}
|
||||
},
|
||||
"line_continuation": {
|
||||
"type": "STRING",
|
||||
"value": "\\\n"
|
||||
"type": "PATTERN",
|
||||
"value": "\\\\[ \\t]*\\n"
|
||||
},
|
||||
"required_line_continuation": {
|
||||
"type": "STRING",
|
||||
|
|
13
src/node-types.json
generated
13
src/node-types.json
generated
|
@ -485,11 +485,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "line_continuation",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "maintainer_instruction",
|
||||
"named": true,
|
||||
|
@ -1061,10 +1056,6 @@
|
|||
"type": "\\",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\\n",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\ ",
|
||||
"named": false
|
||||
|
@ -1093,6 +1084,10 @@
|
|||
"type": "heredoc_marker",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "line_continuation",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "mount",
|
||||
"named": false
|
||||
|
|
11175
src/parser.c
generated
11175
src/parser.c
generated
File diff suppressed because it is too large
Load diff
|
@ -31,6 +31,21 @@ RUN echo "test" \
|
|||
(line_continuation)
|
||||
(shell_fragment))))
|
||||
|
||||
==================
|
||||
Shell command multiline space after continuation
|
||||
==================
|
||||
|
||||
RUN echo "test" \
|
||||
echo "foo"
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(run_instruction
|
||||
(shell_command
|
||||
(shell_fragment
|
||||
(line_continuation)))))
|
||||
|
||||
==================
|
||||
Run with shell empty array
|
||||
==================
|
||||
|
|
Loading…
Reference in a new issue