fix not repeating attributes

This commit is contained in:
Preston Baxter 2024-01-23 23:15:07 -06:00
parent 8677d3fdfa
commit 551eff04b8
6 changed files with 2958 additions and 2785 deletions

View File

@ -3,7 +3,7 @@ module.exports = grammar({
extras: $ => [
/\s/,
/[\r?\n]/,
/\r?\n/,
$.comment
],
@ -66,7 +66,7 @@ module.exports = grammar({
plugin: $ => seq(
$.plugin_name,
"{",
field("attributes", optional(seq($.attribute))),
field("attributes", optional(repeat1($.attribute))),
"}",
),
@ -75,11 +75,12 @@ module.exports = grammar({
$.string
),
arrow: $ => "=>",
attribute: $ => seq(
$.name,
"=>",
$.value,
/\s*\r?\n/
$.arrow,
$.value
),
branch: $ => seq(
@ -161,8 +162,8 @@ module.exports = grammar({
),
hashentry: $ => seq(
choice($.number, $.bareword, $.string),
"=>",
field("name", choice($.number, $.bareword, $.string)),
$.arrow,
$.value
),

View File

@ -27,7 +27,7 @@
; Operators
[
"=>"
(arrow)
] @operator
[

View File

@ -288,13 +288,11 @@
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "attribute"
}
]
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "attribute"
}
},
{
"type": "BLANK"
@ -321,6 +319,10 @@
}
]
},
"arrow": {
"type": "STRING",
"value": "=>"
},
"attribute": {
"type": "SEQ",
"members": [
@ -329,16 +331,12 @@
"name": "name"
},
{
"type": "STRING",
"value": "=>"
"type": "SYMBOL",
"name": "arrow"
},
{
"type": "SYMBOL",
"name": "value"
},
{
"type": "PATTERN",
"value": "\\s*\\r?\\n"
}
]
},
@ -830,25 +828,29 @@
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "number"
},
{
"type": "SYMBOL",
"name": "bareword"
},
{
"type": "SYMBOL",
"name": "string"
}
]
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "number"
},
{
"type": "SYMBOL",
"name": "bareword"
},
{
"type": "SYMBOL",
"name": "string"
}
]
}
},
{
"type": "STRING",
"value": "=>"
"type": "SYMBOL",
"name": "arrow"
},
{
"type": "SYMBOL",
@ -997,7 +999,7 @@
},
{
"type": "PATTERN",
"value": "[\\r?\\n]"
"value": "\\r?\\n"
},
{
"type": "SYMBOL",

View File

@ -22,6 +22,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "arrow",
"named": true
},
{
"type": "name",
"named": true
@ -253,21 +257,32 @@
{
"type": "hashentry",
"named": true,
"fields": {},
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "bareword",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "string",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "bareword",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "string",
"type": "arrow",
"named": true
},
{
@ -422,7 +437,7 @@
"named": true,
"fields": {
"attributes": {
"multiple": false,
"multiple": true,
"required": false,
"types": [
{
@ -699,10 +714,6 @@
"type": "==",
"named": false
},
{
"type": "=>",
"named": false
},
{
"type": "=~",
"named": false
@ -731,6 +742,10 @@
"type": "and",
"named": false
},
{
"type": "arrow",
"named": true
},
{
"type": "bareword",
"named": true

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,10 @@ input {
} else {
mongodb {
server => "asdf"
server => "asdf"
server => "asdf"
server => "asdf"
server => "asdf"
}
}
}