Add support for maintainer instruction

This commit is contained in:
Camden Cheek 2021-05-10 21:16:32 -06:00
parent 550e4cf0a3
commit ca57ec244a
No known key found for this signature in database
GPG key ID: 595BFFE3A04E48B9
5 changed files with 4273 additions and 4123 deletions

10
corpus/maintainer.txt Normal file
View file

@ -0,0 +1,10 @@
==================
Simple
==================
Maintainer camden@ccheek.com
---
(source_file
(maintainer_instruction))

View file

@ -24,6 +24,7 @@ module.exports = grammar({
$.stopsignal_instruction, $.stopsignal_instruction,
$.healthcheck_instruction, $.healthcheck_instruction,
$.shell_instruction, $.shell_instruction,
$.maintainer_instruction,
), ),
from_instruction: $ => seq( from_instruction: $ => seq(
@ -183,6 +184,11 @@ module.exports = grammar({
$._non_newline_whitespace, $._non_newline_whitespace,
$.string_array, $.string_array,
), ),
maintainer_instruction: $ => seq(
alias(/[mM][aA][iI][nN][tT][aA][iI][nN][eE][rR]/, "MAINTAINER"),
/.*/,
),
path: $ => seq( path: $ => seq(
choice( choice(

View file

@ -87,6 +87,10 @@
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "shell_instruction" "name": "shell_instruction"
},
{
"type": "SYMBOL",
"name": "maintainer_instruction"
} }
] ]
}, },
@ -770,6 +774,24 @@
} }
] ]
}, },
"maintainer_instruction": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][aA][iI][nN][tT][aA][iI][nN][eE][rR]"
},
"named": false,
"value": "MAINTAINER"
},
{
"type": "PATTERN",
"value": ".*"
}
]
},
"path": { "path": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [

View file

@ -409,6 +409,11 @@
} }
} }
}, },
{
"type": "maintainer_instruction",
"named": true,
"fields": {}
},
{ {
"type": "onbuild_instruction", "type": "onbuild_instruction",
"named": true, "named": true,
@ -457,6 +462,10 @@
"type": "label_instruction", "type": "label_instruction",
"named": true "named": true
}, },
{
"type": "maintainer_instruction",
"named": true
},
{ {
"type": "onbuild_instruction", "type": "onbuild_instruction",
"named": true "named": true
@ -618,6 +627,10 @@
"type": "label_instruction", "type": "label_instruction",
"named": true "named": true
}, },
{
"type": "maintainer_instruction",
"named": true
},
{ {
"type": "onbuild_instruction", "type": "onbuild_instruction",
"named": true "named": true
@ -842,6 +855,10 @@
"type": "LABEL", "type": "LABEL",
"named": false "named": false
}, },
{
"type": "MAINTAINER",
"named": false
},
{ {
"type": "NONE", "type": "NONE",
"named": false "named": false

File diff suppressed because it is too large Load diff