diff --git a/corpus/add.txt b/corpus/add.txt index 512c436..13aa1b5 100644 --- a/corpus/add.txt +++ b/corpus/add.txt @@ -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))) diff --git a/corpus/copy.txt b/corpus/copy.txt index 83cf305..4882fa5 100644 --- a/corpus/copy.txt +++ b/corpus/copy.txt @@ -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))) diff --git a/grammar.js b/grammar.js index 2e6a6a7..f1a1a88 100644 --- a/grammar.js +++ b/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 ),