simplify object elements
This commit is contained in:
@@ -16,8 +16,6 @@ module.exports = grammar({
|
|||||||
name: 'hcl',
|
name: 'hcl',
|
||||||
|
|
||||||
conflicts: $ => [
|
conflicts: $ => [
|
||||||
[$.body],
|
|
||||||
[$.object_elem, $.variable_expr],
|
|
||||||
[$.attr_splat],
|
[$.attr_splat],
|
||||||
[$.full_splat],
|
[$.full_splat],
|
||||||
// string literals are just quoted template without template stuff
|
// string literals are just quoted template without template stuff
|
||||||
@@ -136,7 +134,7 @@ module.exports = grammar({
|
|||||||
_object_end: $ => '}',
|
_object_end: $ => '}',
|
||||||
|
|
||||||
object_elem: $ => seq(
|
object_elem: $ => seq(
|
||||||
choice($.identifier, $.expression),
|
$.expression,
|
||||||
choice('=', ':'),
|
choice('=', ':'),
|
||||||
$.expression,
|
$.expression,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -414,17 +414,8 @@
|
|||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "SYMBOL",
|
||||||
"members": [
|
"name": "expression"
|
||||||
{
|
|
||||||
"type": "SYMBOL",
|
|
||||||
"name": "identifier"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "SYMBOL",
|
|
||||||
"name": "expression"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
@@ -1219,13 +1210,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"conflicts": [
|
"conflicts": [
|
||||||
[
|
|
||||||
"body"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"object_elem",
|
|
||||||
"variable_expr"
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
"attr_splat"
|
"attr_splat"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -507,10 +507,6 @@
|
|||||||
{
|
{
|
||||||
"type": "expression",
|
"type": "expression",
|
||||||
"named": true
|
"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
|
(collection_value
|
||||||
(object
|
(object
|
||||||
(object_elem
|
(object_elem
|
||||||
(identifier)
|
(expression
|
||||||
|
(variable_expr
|
||||||
|
(identifier)))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier))))))
|
(identifier))))))
|
||||||
|
|||||||
Reference in New Issue
Block a user