allow port ranges

This commit is contained in:
Camden Cheek 2024-04-19 14:46:59 -06:00
parent cde2a8ea7f
commit ecea7ac2c9
No known key found for this signature in database
GPG key ID: 595BFFE3A04E48B9
4 changed files with 654 additions and 633 deletions

View file

@ -287,7 +287,7 @@ module.exports = grammar({
_env_key: ($) => _env_key: ($) =>
alias(/[a-zA-Z_][a-zA-Z0-9_]*/, $.unquoted_string), alias(/[a-zA-Z_][a-zA-Z0-9_]*/, $.unquoted_string),
expose_port: ($) => seq(/\d+/, optional(choice("/tcp", "/udp"))), expose_port: ($) => seq(/\d+(-\d+)?/, optional(choice("/tcp", "/udp"))),
label_pair: ($) => label_pair: ($) =>
seq( seq(

2
src/grammar.json generated
View file

@ -1195,7 +1195,7 @@
"members": [ "members": [
{ {
"type": "PATTERN", "type": "PATTERN",
"value": "\\d+" "value": "\\d+(-\\d+)?"
}, },
{ {
"type": "CHOICE", "type": "CHOICE",

1270
src/parser.c generated

File diff suppressed because it is too large Load diff

View file

@ -25,3 +25,16 @@ EXPOSE 80 90/tcp 100/udp
(expose_port) (expose_port)
(expose_port) (expose_port)
(expose_port))) (expose_port)))
==================
Port range
==================
EXPOSE 9009-9010
---
(source_file
(expose_instruction
(expose_port)))