simplify object elements
This commit is contained in:
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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"
|
||||
],
|
||||
|
||||
@@ -507,10 +507,6 @@
|
||||
{
|
||||
"type": "expression",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
7330
src/parser.c
7330
src/parser.c
File diff suppressed because it is too large
Load Diff
@@ -118,7 +118,9 @@ foo = "${ {a=b}[a] }"
|
||||
(collection_value
|
||||
(object
|
||||
(object_elem
|
||||
(identifier)
|
||||
(expression
|
||||
(variable_expr
|
||||
(identifier)))
|
||||
(expression
|
||||
(variable_expr
|
||||
(identifier))))))
|
||||
|
||||
Reference in New Issue
Block a user