camdencheek / tree-sitter-dockerfile

A tree-sitter grammar for Dockerfile
MIT License
71 stars 20 forks source link

ADD and COPY should support more than two arguments #12

Closed mjambon closed 2 years ago

mjambon commented 2 years ago

A COPY or ADD instruction can copy multiple files but the current grammar supports only one source and the destination. Currently, we're getting this:

$ tree-sitter parse <(echo 'COPY a b c')
(source_file [0, 0] - [1, 0]
  (copy_instruction [0, 0] - [0, 10]
    (path [0, 5] - [0, 6])
    (path [0, 7] - [0, 10])))

We should see 3 path nodes, not 2.