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)
|
||||||
(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)
|
||||||
(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(
|
seq(
|
||||||
alias(/[aA][dD][dD]/, "ADD"),
|
alias(/[aA][dD][dD]/, "ADD"),
|
||||||
optional($.param),
|
optional($.param),
|
||||||
$.path,
|
repeat1(
|
||||||
$._non_newline_whitespace,
|
seq($.path, $._non_newline_whitespace)
|
||||||
|
),
|
||||||
$.path
|
$.path
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -77,8 +78,9 @@ module.exports = grammar({
|
||||||
seq(
|
seq(
|
||||||
alias(/[cC][oO][pP][yY]/, "COPY"),
|
alias(/[cC][oO][pP][yY]/, "COPY"),
|
||||||
optional($.param),
|
optional($.param),
|
||||||
$.path,
|
repeat1(
|
||||||
$._non_newline_whitespace,
|
seq($.path, $._non_newline_whitespace)
|
||||||
|
),
|
||||||
$.path
|
$.path
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue