Support multiple files in ADD/COPY instructions
Fixes https://github.com/camdencheek/tree-sitter-dockerfile/issues/12
This commit is contained in:
parent
28ac8596ba
commit
47a922db41
|
@ -25,3 +25,16 @@ ADD --chown=a:b /src ./dst
|
|||
(path)
|
||||
(path)))
|
||||
|
||||
==================
|
||||
Multiple files
|
||||
==================
|
||||
|
||||
ADD src1 src2 dst
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(add_instruction
|
||||
(path)
|
||||
(path)
|
||||
(path)))
|
||||
|
|
|
@ -25,3 +25,16 @@ COPY --chown=a:b /src ./dst
|
|||
(path)
|
||||
(path)))
|
||||
|
||||
==================
|
||||
Multiple files
|
||||
==================
|
||||
|
||||
COPY src1 src2 dst
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(copy_instruction
|
||||
(path)
|
||||
(path)
|
||||
(path)))
|
||||
|
|
10
grammar.js
10
grammar.js
|
@ -68,8 +68,9 @@ module.exports = grammar({
|
|||
seq(
|
||||
alias(/[aA][dD][dD]/, "ADD"),
|
||||
optional($.param),
|
||||
$.path,
|
||||
$._non_newline_whitespace,
|
||||
repeat1(
|
||||
seq($.path, $._non_newline_whitespace)
|
||||
),
|
||||
$.path
|
||||
),
|
||||
|
||||
|
@ -77,8 +78,9 @@ module.exports = grammar({
|
|||
seq(
|
||||
alias(/[cC][oO][pP][yY]/, "COPY"),
|
||||
optional($.param),
|
||||
$.path,
|
||||
$._non_newline_whitespace,
|
||||
repeat1(
|
||||
seq($.path, $._non_newline_whitespace)
|
||||
),
|
||||
$.path
|
||||
),
|
||||
|
||||
|
|
Loading…
Reference in a new issue