Rename env_spec to expansion
This commit is contained in:
parent
4d4cef8121
commit
0c4af3e20f
|
@ -60,7 +60,7 @@ LABEL key="value${FOO}"
|
||||||
(label_pair
|
(label_pair
|
||||||
key: (unquoted_string)
|
key: (unquoted_string)
|
||||||
value: (double_quoted_string
|
value: (double_quoted_string
|
||||||
(env_spec)))))
|
(expansion)))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Stopsignal
|
Stopsignal
|
||||||
|
@ -72,7 +72,7 @@ STOPSIGNAL $FOO
|
||||||
|
|
||||||
(source_file
|
(source_file
|
||||||
(stopsignal_instruction
|
(stopsignal_instruction
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
User
|
User
|
||||||
|
@ -85,8 +85,8 @@ USER foo$FOO:bar$BAR
|
||||||
(source_file
|
(source_file
|
||||||
(user_instruction
|
(user_instruction
|
||||||
user: (unquoted_string
|
user: (unquoted_string
|
||||||
(env_spec))
|
(expansion))
|
||||||
group: (unquoted_string
|
group: (unquoted_string
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ ADD /$FOO ./${bar}
|
||||||
(source_file
|
(source_file
|
||||||
(add_instruction
|
(add_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))
|
(expansion))
|
||||||
(path
|
(path
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Copy
|
Copy
|
||||||
|
@ -24,9 +24,9 @@ COPY $FOO ./${bar}
|
||||||
(source_file
|
(source_file
|
||||||
(copy_instruction
|
(copy_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))
|
(expansion))
|
||||||
(path
|
(path
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Special chars
|
Special chars
|
||||||
|
@ -39,9 +39,9 @@ COPY $FOO ./${bar:-abc}
|
||||||
(source_file
|
(source_file
|
||||||
(copy_instruction
|
(copy_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))
|
(expansion))
|
||||||
(path
|
(path
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Env
|
Env
|
||||||
|
@ -60,19 +60,19 @@ ENV TEST="foo$BAR" \
|
||||||
(env_pair
|
(env_pair
|
||||||
name: (unquoted_string)
|
name: (unquoted_string)
|
||||||
value: (double_quoted_string
|
value: (double_quoted_string
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
(env_pair
|
(env_pair
|
||||||
name: (unquoted_string)
|
name: (unquoted_string)
|
||||||
value: (unquoted_string
|
value: (unquoted_string
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
(env_pair
|
(env_pair
|
||||||
name: (unquoted_string)
|
name: (unquoted_string)
|
||||||
value: (double_quoted_string
|
value: (double_quoted_string
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
(env_pair
|
(env_pair
|
||||||
name: (unquoted_string)
|
name: (unquoted_string)
|
||||||
value: (unquoted_string
|
value: (unquoted_string
|
||||||
(env_spec)))))
|
(expansion)))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Expose
|
Expose
|
||||||
|
@ -86,7 +86,7 @@ EXPOSE $FOO
|
||||||
(source_file
|
(source_file
|
||||||
(expose_instruction
|
(expose_instruction
|
||||||
(expose_port
|
(expose_port
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
From
|
From
|
||||||
|
@ -100,13 +100,13 @@ FROM foo/$FOO:$BAR@sha256:$BAZ AS baz$QUX
|
||||||
(from_instruction
|
(from_instruction
|
||||||
(image_spec
|
(image_spec
|
||||||
name: (image_name
|
name: (image_name
|
||||||
(env_spec))
|
(expansion))
|
||||||
tag: (image_tag
|
tag: (image_tag
|
||||||
(env_spec))
|
(expansion))
|
||||||
digest: (image_digest
|
digest: (image_digest
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
as: (image_alias
|
as: (image_alias
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Label
|
Label
|
||||||
|
@ -121,7 +121,7 @@ LABEL key="value$FOO"
|
||||||
(label_pair
|
(label_pair
|
||||||
key: (unquoted_string)
|
key: (unquoted_string)
|
||||||
value: (double_quoted_string
|
value: (double_quoted_string
|
||||||
(env_spec)))))
|
(expansion)))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Stopsignal
|
Stopsignal
|
||||||
|
@ -133,7 +133,7 @@ STOPSIGNAL $FOO
|
||||||
|
|
||||||
(source_file
|
(source_file
|
||||||
(stopsignal_instruction
|
(stopsignal_instruction
|
||||||
(env_spec)))
|
(expansion)))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
User
|
User
|
||||||
|
@ -146,9 +146,9 @@ USER foo$FOO:bar${bar}
|
||||||
(source_file
|
(source_file
|
||||||
(user_instruction
|
(user_instruction
|
||||||
user: (unquoted_string
|
user: (unquoted_string
|
||||||
(env_spec))
|
(expansion))
|
||||||
group: (unquoted_string
|
group: (unquoted_string
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Volume
|
Volume
|
||||||
|
@ -162,9 +162,9 @@ volume /my$FOO /my${bar}
|
||||||
(source_file
|
(source_file
|
||||||
(volume_instruction
|
(volume_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))
|
(expansion))
|
||||||
(path
|
(path
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
==================
|
==================
|
||||||
Workdir
|
Workdir
|
||||||
|
@ -177,7 +177,7 @@ WORKDIR /tmp/$FOO
|
||||||
(source_file
|
(source_file
|
||||||
(workdir_instruction
|
(workdir_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))))
|
(expansion))))
|
||||||
|
|
||||||
|
|
||||||
==================
|
==================
|
||||||
|
@ -192,6 +192,6 @@ ONBUILD ADD /$FOO ./${bar}
|
||||||
(onbuild_instruction
|
(onbuild_instruction
|
||||||
(add_instruction
|
(add_instruction
|
||||||
(path
|
(path
|
||||||
(env_spec))
|
(expansion))
|
||||||
(path
|
(path
|
||||||
(env_spec)))))
|
(expansion)))))
|
||||||
|
|
24
grammar.js
24
grammar.js
|
@ -124,7 +124,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
_user_name_group: $ => repeat1(choice(
|
_user_name_group: $ => repeat1(choice(
|
||||||
token.immediate(/[a-z][-a-z0-9_]*/),
|
token.immediate(/[a-z][-a-z0-9_]*/),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
workdir_instruction: $ => seq(
|
workdir_instruction: $ => seq(
|
||||||
|
@ -160,7 +160,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
_stopsignal_value: $ => repeat1(choice(
|
_stopsignal_value: $ => repeat1(choice(
|
||||||
/[A-Z0-9]+/,
|
/[A-Z0-9]+/,
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
healthcheck_instruction: $ => seq(
|
healthcheck_instruction: $ => seq(
|
||||||
|
@ -184,15 +184,15 @@ module.exports = grammar({
|
||||||
path: $ => seq(
|
path: $ => seq(
|
||||||
choice(
|
choice(
|
||||||
/[^-\s]/, // cannot start with a '-' to avoid conflicts with params
|
/[^-\s]/, // cannot start with a '-' to avoid conflicts with params
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
),
|
),
|
||||||
repeat(choice(
|
repeat(choice(
|
||||||
token.immediate(/[^\s\$]+/),
|
token.immediate(/[^\s\$]+/),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
||||||
env_spec: $ => seq(
|
expansion: $ => seq(
|
||||||
'$',
|
'$',
|
||||||
repeat1(choice(
|
repeat1(choice(
|
||||||
token.immediate(/[a-zA-Z][a-zA-Z0-9_]*/),
|
token.immediate(/[a-zA-Z][a-zA-Z0-9_]*/),
|
||||||
|
@ -218,7 +218,7 @@ module.exports = grammar({
|
||||||
"/udp",
|
"/udp",
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
),
|
),
|
||||||
|
|
||||||
label_pair: $ => seq(
|
label_pair: $ => seq(
|
||||||
|
@ -240,14 +240,14 @@ module.exports = grammar({
|
||||||
|
|
||||||
image_name: $ => repeat1(choice(
|
image_name: $ => repeat1(choice(
|
||||||
token.immediate(/[^@:\s\$]+/),
|
token.immediate(/[^@:\s\$]+/),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
image_tag: $ => seq(
|
image_tag: $ => seq(
|
||||||
token.immediate(":"),
|
token.immediate(":"),
|
||||||
repeat1(choice(
|
repeat1(choice(
|
||||||
token.immediate(/[^@\s\$]+/),
|
token.immediate(/[^@\s\$]+/),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ module.exports = grammar({
|
||||||
token.immediate("@"),
|
token.immediate("@"),
|
||||||
repeat1(choice(
|
repeat1(choice(
|
||||||
token.immediate(/[a-zA-Z0-9:]+/),
|
token.immediate(/[a-zA-Z0-9:]+/),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
image_alias: $ => repeat1(choice(
|
image_alias: $ => repeat1(choice(
|
||||||
/[-a-zA-Z0-9_]+/,
|
/[-a-zA-Z0-9_]+/,
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
string_array: $ => seq(
|
string_array: $ => seq(
|
||||||
|
@ -290,7 +290,7 @@ module.exports = grammar({
|
||||||
repeat(choice(
|
repeat(choice(
|
||||||
token.immediate(prec(1, /[^"\n\\\$]+/)),
|
token.immediate(prec(1, /[^"\n\\\$]+/)),
|
||||||
$.escape_sequence,
|
$.escape_sequence,
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
'"'
|
'"'
|
||||||
),
|
),
|
||||||
|
@ -298,7 +298,7 @@ module.exports = grammar({
|
||||||
unquoted_string: $ => repeat1(choice(
|
unquoted_string: $ => repeat1(choice(
|
||||||
token.immediate(/[^\s\n\"\\\$]+/),
|
token.immediate(/[^\s\n\"\\\$]+/),
|
||||||
token.immediate("\\ "),
|
token.immediate("\\ "),
|
||||||
$.env_spec,
|
$.expansion,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
escape_sequence: $ => token.immediate(seq(
|
escape_sequence: $ => token.immediate(seq(
|
||||||
|
|
|
@ -536,7 +536,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -768,7 +768,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -786,14 +786,14 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"env_spec": {
|
"expansion": {
|
||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
@ -911,7 +911,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1021,7 +1021,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1050,7 +1050,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1081,7 +1081,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1137,7 +1137,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1242,7 +1242,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1274,7 +1274,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "env_spec"
|
"name": "expansion"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,11 +100,11 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "escape_sequence",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "escape_sequence",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -175,7 +175,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {}
|
||||||
},
|
},
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -282,7 +282,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -297,7 +297,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -348,7 +348,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -492,7 +492,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -625,7 +625,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -655,7 +655,7 @@
|
||||||
"required": false,
|
"required": false,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "env_spec",
|
"type": "expansion",
|
||||||
"named": true
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
488
src/parser.c
488
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue