Commit graph

37 commits

Author SHA1 Message Date
Camden Cheek 439c3e7b8a
use extra to allow comments anywhere 2024-04-19 15:28:09 -06:00
Camden Cheek 40eceeff30
allow space after backslash to act as line continuation (#49) 2024-04-19 15:02:25 -06:00
Camden Cheek ecea7ac2c9
allow port ranges 2024-04-19 14:46:59 -06:00
Camden Cheek c4c8fd83f5
Configure CI (#41) 2024-04-19 14:20:33 -06:00
tvrinssen 1bf9daef46
Support heredocs (#45)
This adds support for heredocs in Dockerfiles. This required adding an external scanner to store the required state.

Co-authored-by: Camden Cheek <camden@ccheek.com>
2024-04-19 14:08:28 -06:00
Eric Crosson c9351d9009 support multiple parameters to ADD and COPY
This commit adds support for parsing multiple parameters to both `ADD`
and `COPY` commands.

For example, tree-sitter-dockerfile now correctly parses both of these
lines from the dockerfile reference[^1]:

```dockerfile
ADD --chown=myuser:mygroup --chmod=655 files* /somedir/
COPY --chown=myuser:mygroup --chmod=644 files* /somedir/
```

Closes #43

[^1]: https://docs.docker.com/engine/reference/builder/
2023-10-09 18:40:56 -05:00
Camden Cheek 1800d5a067
bump tree-sitter-cli version 2023-09-28 09:05:26 -06:00
Ken Micklas 0ddac88c66 Regenerate 2023-09-27 19:35:30 +01:00
Martin Jambon 2a43a1c184 Regenerate 2023-06-23 14:55:54 -07:00
Kevin Witlox dd30de55fb Fix error if USER username/group contains capital 2023-05-02 20:54:19 +02:00
Martin Jambon 771fccc7ec Regenerate 2023-02-21 14:40:46 -08:00
Marcio Mazza 4e512c60ef Allow variables to begin or end with underscores 2022-09-13 20:27:53 -03:00
Martin Jambon 1c0b92971c Regenerate 2022-04-04 19:10:55 -07:00
Camden Cheek 71ac1e8880
allow numeric users and groups
Previously, users and groups were set to only allow alphabetical first
characters.
2022-03-07 11:02:36 -07:00
Camden Cheek d34a0cebd0
allow one-letter environment variables
This fixes issue #11. Previously, we required environment variable names
to be one ASCII letter followed by one or more characters, but this
makes the following characters optional.
2022-01-27 11:20:14 -07:00
Martin Jambon fbbf542d58 Regenerate 2022-01-26 14:42:39 -08:00
Camden Cheek 28ac8596ba
add optional leading comment to shell_command
Previously, if a shell command started with a comment line, parsing
would fail because shell_command expected the first line to be a shell
line. This adds an optional comment to the beginning of the
shell_command to handle this correctly.
2022-01-23 12:37:35 -07:00
Stephan Seitz fca82f8774 Update tree-sitter-cli: 0.19.4 -> 0.20.1 2022-01-13 09:53:10 +01:00
Stephan Seitz 44be8fbf72 fix: allow empty value for env_pair 2022-01-12 22:43:34 +01:00
Martin Jambon e0fa91d34a Distinguish line continuation that can occur anywhere (in 'extras') from
line continuation in shell command rule so as to know which is which
when recovering a typed tree with ocaml-tree-sitter.
See https://github.com/returntocorp/ocaml-tree-sitter-core/pull/20
2021-12-15 22:31:20 -08:00
Camden Cheek d4f9099f9a
simplify comment definition 2021-06-20 12:46:57 -06:00
Camden Cheek 23ca71644d
remove unnecessary _non_newline_whitespace 2021-06-20 12:34:59 -06:00
Camden Cheek 63b21914a5
remove unnecessary precedence 2021-06-20 11:57:44 -06:00
Camden Cheek 739747c15a
use line_continuation instead of token literal 2021-06-20 11:55:27 -06:00
Camden Cheek d812f3a7fc
comments must start at beginning of line
Previously, this grammar allowed comments to start partway through
lines, but per the Dockerfile spec, that is not valid.
2021-06-20 11:47:14 -06:00
Camden Cheek 3a6c457095
Add support for the CROSS_BUILD instruction set 2021-05-11 08:47:20 -06:00
Camden Cheek 215639ff94
Fix parsing short env vars 2021-05-11 08:19:44 -06:00
Camden Cheek 00c68f09db
Allow square brackets after first character in shell fragment 2021-05-10 21:23:10 -06:00
Camden Cheek ca57ec244a
Add support for maintainer instruction 2021-05-10 21:16:32 -06:00
Camden Cheek 550e4cf0a3
Use immediate 2021-05-10 21:04:55 -06:00
Camden Cheek 732a4f0e4f
Add support for space-separated env instruction 2021-05-10 20:27:22 -06:00
Camden Cheek 3693a2fd05
Add support for shell fragments separated by comments 2021-05-10 18:55:28 -06:00
Camden Cheek 74e7f4c3e6
Name variable node for expansions 2021-05-10 17:35:00 -06:00
Camden Cheek 0c4af3e20f
Rename env_spec to expansion 2021-05-10 17:25:35 -06:00
Camden Cheek c281dc9daa
Fix image alias 2021-05-10 17:17:50 -06:00
Camden Cheek 3055288ce1
Add support for replacement vars 2021-05-10 15:16:09 -06:00
Camden Cheek b1fbbe6612
Initial working 2021-05-09 20:11:30 -06:00