Merge pull request #44 from EricCrosson/43-support-multiple-parameters-to-add-and-copy

support multiple parameters to ADD and COPY
This commit is contained in:
Camden Cheek 2023-10-10 11:42:39 -05:00 committed by GitHub
commit 33e22c33bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4122 additions and 4052 deletions

View file

@ -38,3 +38,18 @@ ADD src1 src2 dst
(path) (path)
(path) (path)
(path))) (path)))
==================
Multiple params
==================
ADD --chown=a:b --chmod=644 src dst
---
(source_file
(add_instruction
(param)
(param)
(path)
(path)))

View file

@ -38,3 +38,18 @@ COPY src1 src2 dst
(path) (path)
(path) (path)
(path))) (path)))
==================
Multiple params
==================
COPY --chown=a:b --chmod=644 src dst
---
(source_file
(copy_instruction
(param)
(param)
(path)
(path)))

View file

@ -73,7 +73,7 @@ module.exports = grammar({
add_instruction: ($) => add_instruction: ($) =>
seq( seq(
alias(/[aA][dD][dD]/, "ADD"), alias(/[aA][dD][dD]/, "ADD"),
optional($.param), repeat($.param),
repeat1( repeat1(
seq($.path, $._non_newline_whitespace) seq($.path, $._non_newline_whitespace)
), ),
@ -83,7 +83,7 @@ module.exports = grammar({
copy_instruction: ($) => copy_instruction: ($) =>
seq( seq(
alias(/[cC][oO][pP][yY]/, "COPY"), alias(/[cC][oO][pP][yY]/, "COPY"),
optional($.param), repeat($.param),
repeat1( repeat1(
seq($.path, $._non_newline_whitespace) seq($.path, $._non_newline_whitespace)
), ),

View file

@ -336,16 +336,11 @@
"value": "ADD" "value": "ADD"
}, },
{ {
"type": "CHOICE", "type": "REPEAT",
"members": [ "content": {
{ "type": "SYMBOL",
"type": "SYMBOL", "name": "param"
"name": "param" }
},
{
"type": "BLANK"
}
]
}, },
{ {
"type": "REPEAT1", "type": "REPEAT1",
@ -382,16 +377,11 @@
"value": "COPY" "value": "COPY"
}, },
{ {
"type": "CHOICE", "type": "REPEAT",
"members": [ "content": {
{ "type": "SYMBOL",
"type": "SYMBOL", "name": "param"
"name": "param" }
},
{
"type": "BLANK"
}
]
}, },
{ {
"type": "REPEAT1", "type": "REPEAT1",

File diff suppressed because it is too large Load diff