make object, block and tuple delimiters visible
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.5.0 - not yet released
|
||||||
|
|
||||||
|
feature:
|
||||||
|
* unhide `(block|object|tuple)_(start|end)` tokens
|
||||||
|
|
||||||
## 0.4.0 - 2021-07-02
|
## 0.4.0 - 2021-07-02
|
||||||
|
|
||||||
feature:
|
feature:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ resource_1 "strlit1" "strlit2" {
|
|||||||
|
|
||||||
func_of_object = func({
|
func_of_object = func({
|
||||||
"foo" : 2,
|
"foo" : 2,
|
||||||
"bar" : baz
|
"bar" : baz,
|
||||||
key : val,
|
key : val,
|
||||||
fizz : buzz,
|
fizz : buzz,
|
||||||
})
|
})
|
||||||
|
|||||||
32
grammar.js
32
grammar.js
@@ -53,13 +53,13 @@ module.exports = grammar({
|
|||||||
block: $ => seq(
|
block: $ => seq(
|
||||||
$.identifier,
|
$.identifier,
|
||||||
repeat(choice($.string_lit, $.identifier)),
|
repeat(choice($.string_lit, $.identifier)),
|
||||||
$._block_start,
|
$.block_start,
|
||||||
optional($.body),
|
optional($.body),
|
||||||
$._block_end,
|
$.block_end,
|
||||||
),
|
),
|
||||||
|
|
||||||
_block_start: $ => '{',
|
block_start: $ => '{',
|
||||||
_block_end: $ => '}',
|
block_end: $ => '}',
|
||||||
|
|
||||||
identifier: $ => token(seq(
|
identifier: $ => token(seq(
|
||||||
choice(/\p{ID_Start}/, '_'),
|
choice(/\p{ID_Start}/, '_'),
|
||||||
@@ -119,13 +119,13 @@ module.exports = grammar({
|
|||||||
_comma: $ => ',',
|
_comma: $ => ',',
|
||||||
|
|
||||||
tuple: $ => seq(
|
tuple: $ => seq(
|
||||||
$._tuple_start,
|
$.tuple_start,
|
||||||
optional($._tuple_elems),
|
optional($._tuple_elems),
|
||||||
$._tuple_end,
|
$.tuple_end,
|
||||||
),
|
),
|
||||||
|
|
||||||
_tuple_start: $ => '[',
|
tuple_start: $ => '[',
|
||||||
_tuple_end: $ => ']',
|
tuple_end: $ => ']',
|
||||||
|
|
||||||
_tuple_elems: $ => seq(
|
_tuple_elems: $ => seq(
|
||||||
$.expression,
|
$.expression,
|
||||||
@@ -137,13 +137,13 @@ module.exports = grammar({
|
|||||||
),
|
),
|
||||||
|
|
||||||
object: $ => seq(
|
object: $ => seq(
|
||||||
$._object_start,
|
$.object_start,
|
||||||
optional($._object_elems),
|
optional($._object_elems),
|
||||||
$._object_end,
|
$.object_end,
|
||||||
),
|
),
|
||||||
|
|
||||||
_object_start: $ => '{',
|
object_start: $ => '{',
|
||||||
_object_end: $ => '}',
|
object_end: $ => '}',
|
||||||
|
|
||||||
_object_elems: $ => seq(
|
_object_elems: $ => seq(
|
||||||
$.object_elem,
|
$.object_elem,
|
||||||
@@ -182,22 +182,22 @@ module.exports = grammar({
|
|||||||
for_expr: $ => choice($.for_tuple_expr, $.for_object_expr),
|
for_expr: $ => choice($.for_tuple_expr, $.for_object_expr),
|
||||||
|
|
||||||
for_tuple_expr: $ => seq(
|
for_tuple_expr: $ => seq(
|
||||||
$._tuple_start,
|
$.tuple_start,
|
||||||
$.for_intro,
|
$.for_intro,
|
||||||
$.expression,
|
$.expression,
|
||||||
optional($.for_cond),
|
optional($.for_cond),
|
||||||
$._tuple_end,
|
$.tuple_end,
|
||||||
),
|
),
|
||||||
|
|
||||||
for_object_expr: $ => seq(
|
for_object_expr: $ => seq(
|
||||||
$._object_start,
|
$.object_start,
|
||||||
$.for_intro,
|
$.for_intro,
|
||||||
$.expression,
|
$.expression,
|
||||||
'=>',
|
'=>',
|
||||||
$.expression,
|
$.expression,
|
||||||
optional($.ellipsis),
|
optional($.ellipsis),
|
||||||
optional($.for_cond),
|
optional($.for_cond),
|
||||||
$._object_end,
|
$.object_end,
|
||||||
),
|
),
|
||||||
|
|
||||||
for_intro: $ => seq(
|
for_intro: $ => seq(
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_block_start"
|
"name": "block_start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
@@ -96,15 +96,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_block_end"
|
"name": "block_end"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_block_start": {
|
"block_start": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "{"
|
"value": "{"
|
||||||
},
|
},
|
||||||
"_block_end": {
|
"block_end": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "}"
|
"value": "}"
|
||||||
},
|
},
|
||||||
@@ -345,7 +345,7 @@
|
|||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_tuple_start"
|
"name": "tuple_start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
@@ -361,15 +361,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_tuple_end"
|
"name": "tuple_end"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_tuple_start": {
|
"tuple_start": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "["
|
"value": "["
|
||||||
},
|
},
|
||||||
"_tuple_end": {
|
"tuple_end": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "]"
|
"value": "]"
|
||||||
},
|
},
|
||||||
@@ -415,7 +415,7 @@
|
|||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_object_start"
|
"name": "object_start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
@@ -431,15 +431,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_object_end"
|
"name": "object_end"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_object_start": {
|
"object_start": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "{"
|
"value": "{"
|
||||||
},
|
},
|
||||||
"_object_end": {
|
"object_end": {
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "}"
|
"value": "}"
|
||||||
},
|
},
|
||||||
@@ -667,7 +667,7 @@
|
|||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_tuple_start"
|
"name": "tuple_start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
@@ -691,7 +691,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_tuple_end"
|
"name": "tuple_end"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -700,7 +700,7 @@
|
|||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_object_start"
|
"name": "object_start"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
@@ -744,7 +744,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_object_end"
|
"name": "object_end"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -100,6 +100,14 @@
|
|||||||
"multiple": true,
|
"multiple": true,
|
||||||
"required": true,
|
"required": true,
|
||||||
"types": [
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "block_end",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "block_start",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "body",
|
"type": "body",
|
||||||
"named": true
|
"named": true
|
||||||
@@ -115,6 +123,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "block_end",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "block_start",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "body",
|
"type": "body",
|
||||||
"named": true,
|
"named": true,
|
||||||
@@ -327,6 +345,14 @@
|
|||||||
{
|
{
|
||||||
"type": "for_intro",
|
"type": "for_intro",
|
||||||
"named": true
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object_end",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object_start",
|
||||||
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -350,6 +376,14 @@
|
|||||||
{
|
{
|
||||||
"type": "for_intro",
|
"type": "for_intro",
|
||||||
"named": true
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_end",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_start",
|
||||||
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -539,11 +573,19 @@
|
|||||||
"fields": {},
|
"fields": {},
|
||||||
"children": {
|
"children": {
|
||||||
"multiple": true,
|
"multiple": true,
|
||||||
"required": false,
|
"required": true,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "object_elem",
|
"type": "object_elem",
|
||||||
"named": true
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object_end",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object_start",
|
||||||
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -574,6 +616,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "object_end",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object_start",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "operation",
|
"type": "operation",
|
||||||
"named": true,
|
"named": true,
|
||||||
@@ -728,15 +780,33 @@
|
|||||||
"fields": {},
|
"fields": {},
|
||||||
"children": {
|
"children": {
|
||||||
"multiple": true,
|
"multiple": true,
|
||||||
"required": false,
|
"required": true,
|
||||||
"types": [
|
"types": [
|
||||||
{
|
{
|
||||||
"type": "expression",
|
"type": "expression",
|
||||||
"named": true
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_end",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_start",
|
||||||
|
"named": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_end",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tuple_start",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "unary_operation",
|
"type": "unary_operation",
|
||||||
"named": true,
|
"named": true,
|
||||||
|
|||||||
17531
src/parser.c
17531
src/parser.c
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,9 @@ block_1 {
|
|||||||
(config_file
|
(config_file
|
||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier))))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
basic block on one line
|
basic block on one line
|
||||||
@@ -23,7 +25,9 @@ block_1 {}
|
|||||||
(config_file
|
(config_file
|
||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier))))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
block with attribute
|
block with attribute
|
||||||
@@ -47,6 +51,7 @@ block_1 "strlit1" "strlit2" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -55,7 +60,8 @@ block_1 "strlit1" "strlit2" {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
nested block
|
nested block
|
||||||
@@ -72,9 +78,13 @@ block_1 {
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier))))))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end)))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
nested block on one line
|
nested block on one line
|
||||||
@@ -90,9 +100,13 @@ block_1 {
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier))))))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end)))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
nested blocks
|
nested blocks
|
||||||
@@ -109,11 +123,17 @@ block_1 {
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end))
|
||||||
(block
|
(block
|
||||||
(identifier))))))
|
(identifier)
|
||||||
|
(block_start)
|
||||||
|
(block_end)))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
one line block
|
one line block
|
||||||
@@ -128,6 +148,7 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -148,4 +169,5 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
|||||||
(template_expr
|
(template_expr
|
||||||
(quoted_template
|
(quoted_template
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(quoted_template_end))))))))))))
|
(quoted_template_end)))))))))
|
||||||
|
(block_end))))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ foo = [1, 2, "foo"]
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(numeric_lit)))
|
(numeric_lit)))
|
||||||
@@ -24,7 +25,8 @@ foo = [1, 2, "foo"]
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
multiline tuple
|
multiline tuple
|
||||||
@@ -45,6 +47,7 @@ foo = [
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(numeric_lit)))
|
(numeric_lit)))
|
||||||
@@ -56,7 +59,8 @@ foo = [
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
empty tuple
|
empty tuple
|
||||||
@@ -72,7 +76,9 @@ foo = []
|
|||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple))))))
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
multiline empty tuple
|
multiline empty tuple
|
||||||
@@ -89,7 +95,9 @@ foo = [
|
|||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple))))))
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
object
|
object
|
||||||
@@ -106,6 +114,7 @@ foo = {1: 2, "foo"="bar"}
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
@@ -125,7 +134,8 @@ foo = {1: 2, "foo"="bar"}
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))))
|
(quoted_template_end)))))
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
multiline object
|
multiline object
|
||||||
@@ -145,6 +155,7 @@ foo = {
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
@@ -164,7 +175,8 @@ foo = {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))))
|
(quoted_template_end)))))
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
empty object
|
empty object
|
||||||
@@ -180,7 +192,9 @@ foo = { }
|
|||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object))))))
|
(object
|
||||||
|
(object_start)
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
multiline empty object
|
multiline empty object
|
||||||
@@ -197,7 +211,9 @@ foo = {
|
|||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object))))))
|
(object
|
||||||
|
(object_start)
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
multiline object weird newlines
|
multiline object weird newlines
|
||||||
@@ -217,6 +233,7 @@ foo = { 1: 2,
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
@@ -236,7 +253,8 @@ foo = { 1: 2,
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))))
|
(quoted_template_end)))))
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
complex object
|
complex object
|
||||||
@@ -256,6 +274,7 @@ foo = {
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
@@ -275,7 +294,8 @@ foo = {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))))
|
(quoted_template_end)))))
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
complex from real world
|
complex from real world
|
||||||
@@ -305,9 +325,11 @@ worker_groups = [
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
@@ -342,16 +364,20 @@ worker_groups = [
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier))
|
(identifier))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier))
|
(identifier))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier))))))))))
|
(identifier)))
|
||||||
|
(tuple_end)))))
|
||||||
|
(object_end))))
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
@@ -379,17 +405,21 @@ worker_groups = [
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier))
|
(identifier))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier))
|
(identifier))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier)))))))
|
(identifier)))
|
||||||
|
(tuple_end)))))
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(numeric_lit)))))))))))))
|
(numeric_lit))))
|
||||||
|
(object_end))))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ foo = [for v in ["a", "b"]: v]
|
|||||||
(expression
|
(expression
|
||||||
(for_expr
|
(for_expr
|
||||||
(for_tuple_expr
|
(for_tuple_expr
|
||||||
|
(tuple_start)
|
||||||
(for_intro
|
(for_intro
|
||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -29,10 +31,12 @@ foo = [for v in ["a", "b"]: v]
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))))))))
|
(identifier)))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
for tuple expression with index
|
for tuple expression with index
|
||||||
@@ -49,12 +53,14 @@ foo = [for i, v in ["a", "b"]: i]
|
|||||||
(expression
|
(expression
|
||||||
(for_expr
|
(for_expr
|
||||||
(for_tuple_expr
|
(for_tuple_expr
|
||||||
|
(tuple_start)
|
||||||
(for_intro
|
(for_intro
|
||||||
(identifier)
|
(identifier)
|
||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -66,10 +72,12 @@ foo = [for i, v in ["a", "b"]: i]
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))))))))
|
(identifier)))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
for tuple expression with predicate
|
for tuple expression with predicate
|
||||||
@@ -86,12 +94,14 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
|
|||||||
(expression
|
(expression
|
||||||
(for_expr
|
(for_expr
|
||||||
(for_tuple_expr
|
(for_tuple_expr
|
||||||
|
(tuple_start)
|
||||||
(for_intro
|
(for_intro
|
||||||
(identifier)
|
(identifier)
|
||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -109,7 +119,8 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
@@ -120,7 +131,8 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
|
|||||||
(function_arguments
|
(function_arguments
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))))))))))))
|
(identifier)))))))
|
||||||
|
(tuple_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
for object expression
|
for object expression
|
||||||
@@ -137,12 +149,14 @@ foo = {for i, v in ["a", "b"]: v => i}
|
|||||||
(expression
|
(expression
|
||||||
(for_expr
|
(for_expr
|
||||||
(for_object_expr
|
(for_object_expr
|
||||||
|
(object_start)
|
||||||
(for_intro
|
(for_intro
|
||||||
(identifier)
|
(identifier)
|
||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -154,13 +168,15 @@ foo = {for i, v in ["a", "b"]: v => i}
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))))))))
|
(identifier)))
|
||||||
|
(object_end)))))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
for object expression 2
|
for object expression 2
|
||||||
@@ -177,12 +193,14 @@ foo = {for i, v in ["a", "b"]: v => i...}
|
|||||||
(expression
|
(expression
|
||||||
(for_expr
|
(for_expr
|
||||||
(for_object_expr
|
(for_object_expr
|
||||||
|
(object_start)
|
||||||
(for_intro
|
(for_intro
|
||||||
(identifier)
|
(identifier)
|
||||||
(identifier)
|
(identifier)
|
||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(tuple
|
(tuple
|
||||||
|
(tuple_start)
|
||||||
(expression
|
(expression
|
||||||
(literal_value
|
(literal_value
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -194,11 +212,13 @@ foo = {for i, v in ["a", "b"]: v => i...}
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))))))))
|
(quoted_template_end))))
|
||||||
|
(tuple_end)))))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
(ellipsis)))))))
|
(ellipsis)
|
||||||
|
(object_end)))))))
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ provider "kubernetes" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -59,7 +60,8 @@ provider "kubernetes" {
|
|||||||
(index
|
(index
|
||||||
(legacy_index))
|
(legacy_index))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier)))))))))))
|
(identifier))))))))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
example 2
|
example 2
|
||||||
@@ -111,6 +113,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -175,7 +178,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier))
|
(identifier))
|
||||||
(get_attr
|
(get_attr
|
||||||
(identifier))))))))
|
(identifier)))))))
|
||||||
|
(block_end))
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -186,6 +190,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -229,7 +234,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -240,6 +246,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -283,7 +290,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -294,6 +302,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -358,7 +367,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
(string_lit
|
(string_lit
|
||||||
@@ -369,6 +379,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end))
|
(quoted_template_end))
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -445,7 +456,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
|
|||||||
(string_lit
|
(string_lit
|
||||||
(quoted_template_start)
|
(quoted_template_start)
|
||||||
(template_literal)
|
(template_literal)
|
||||||
(quoted_template_end)))))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
example 3
|
example 3
|
||||||
@@ -494,6 +506,7 @@ locals {
|
|||||||
(body
|
(body
|
||||||
(block
|
(block
|
||||||
(identifier)
|
(identifier)
|
||||||
|
(block_start)
|
||||||
(body
|
(body
|
||||||
(attribute
|
(attribute
|
||||||
(identifier)
|
(identifier)
|
||||||
@@ -530,4 +543,5 @@ locals {
|
|||||||
(get_attr
|
(get_attr
|
||||||
(identifier)))))
|
(identifier)))))
|
||||||
(template_interpolation_end))
|
(template_interpolation_end))
|
||||||
(quoted_template_end)))))))))
|
(quoted_template_end))))))
|
||||||
|
(block_end))))
|
||||||
|
|||||||
@@ -206,13 +206,15 @@ foo = "${ {a=b}[a] }"
|
|||||||
(expression
|
(expression
|
||||||
(collection_value
|
(collection_value
|
||||||
(object
|
(object
|
||||||
|
(object_start)
|
||||||
(object_elem
|
(object_elem
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier)))
|
(identifier)))
|
||||||
(expression
|
(expression
|
||||||
(variable_expr
|
(variable_expr
|
||||||
(identifier))))))
|
(identifier))))
|
||||||
|
(object_end)))
|
||||||
(index
|
(index
|
||||||
(new_index
|
(new_index
|
||||||
(expression
|
(expression
|
||||||
|
|||||||
Reference in New Issue
Block a user