simplify object elements

This commit is contained in:
mhoffm
2021-06-18 07:20:55 +02:00
parent f4b4b4f026
commit b793cd7c37
5 changed files with 3653 additions and 3709 deletions

View File

@@ -16,8 +16,6 @@ module.exports = grammar({
name: 'hcl',
conflicts: $ => [
[$.body],
[$.object_elem, $.variable_expr],
[$.attr_splat],
[$.full_splat],
// string literals are just quoted template without template stuff
@@ -136,7 +134,7 @@ module.exports = grammar({
_object_end: $ => '}',
object_elem: $ => seq(
choice($.identifier, $.expression),
$.expression,
choice('=', ':'),
$.expression,
),

View File

@@ -414,17 +414,8 @@
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "expression"
}
]
"type": "SYMBOL",
"name": "expression"
},
{
"type": "CHOICE",
@@ -1219,13 +1210,6 @@
}
],
"conflicts": [
[
"body"
],
[
"object_elem",
"variable_expr"
],
[
"attr_splat"
],

View File

@@ -507,10 +507,6 @@
{
"type": "expression",
"named": true
},
{
"type": "identifier",
"named": true
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -118,7 +118,9 @@ foo = "${ {a=b}[a] }"
(collection_value
(object
(object_elem
(identifier)
(expression
(variable_expr
(identifier)))
(expression
(variable_expr
(identifier))))))