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",
|
required_line_continuation: ($) => "\\\n",
|
||||||
|
|
||||||
_comment_line: ($) => seq(alias($._anon_comment, $.comment), "\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": {
|
"line_continuation": {
|
||||||
"type": "STRING",
|
"type": "PATTERN",
|
||||||
"value": "\\\n"
|
"value": "\\\\[ \\t]*\\n"
|
||||||
},
|
},
|
||||||
"required_line_continuation": {
|
"required_line_continuation": {
|
||||||
"type": "STRING",
|
"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",
|
"type": "maintainer_instruction",
|
||||||
"named": true,
|
"named": true,
|
||||||
|
@ -1061,10 +1056,6 @@
|
||||||
"type": "\\",
|
"type": "\\",
|
||||||
"named": false
|
"named": false
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "\\\n",
|
|
||||||
"named": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "\\ ",
|
"type": "\\ ",
|
||||||
"named": false
|
"named": false
|
||||||
|
@ -1093,6 +1084,10 @@
|
||||||
"type": "heredoc_marker",
|
"type": "heredoc_marker",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "line_continuation",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "mount",
|
"type": "mount",
|
||||||
"named": false
|
"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)
|
(line_continuation)
|
||||||
(shell_fragment))))
|
(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
|
Run with shell empty array
|
||||||
==================
|
==================
|
||||||
|
|
Loading…
Reference in a new issue