make object, block and tuple delimiters visible

This commit is contained in:
mhoffm
2021-07-04 10:40:40 +02:00
committed by Michael Hoffmann
parent 88c7c031d1
commit 7a12dfe711
11 changed files with 9168 additions and 8674 deletions

View File

@@ -10,7 +10,9 @@ block_1 {
(config_file
(body
(block
(identifier))))
(identifier)
(block_start)
(block_end))))
================================================================================
basic block on one line
@@ -23,7 +25,9 @@ block_1 {}
(config_file
(body
(block
(identifier))))
(identifier)
(block_start)
(block_end))))
================================================================================
block with attribute
@@ -47,6 +51,7 @@ block_1 "strlit1" "strlit2" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -55,7 +60,8 @@ block_1 "strlit1" "strlit2" {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))
(quoted_template_end))))))
(block_end))))
================================================================================
nested block
@@ -72,9 +78,13 @@ block_1 {
(body
(block
(identifier)
(block_start)
(body
(block
(identifier))))))
(identifier)
(block_start)
(block_end)))
(block_end))))
================================================================================
nested block on one line
@@ -90,9 +100,13 @@ block_1 {
(body
(block
(identifier)
(block_start)
(body
(block
(identifier))))))
(identifier)
(block_start)
(block_end)))
(block_end))))
================================================================================
nested blocks
@@ -109,11 +123,17 @@ block_1 {
(body
(block
(identifier)
(block_start)
(body
(block
(identifier))
(identifier)
(block_start)
(block_end))
(block
(identifier))))))
(identifier)
(block_start)
(block_end)))
(block_end))))
================================================================================
one line block
@@ -128,6 +148,7 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
(body
(block
(identifier)
(block_start)
(body
(attribute
(identifier)
@@ -148,4 +169,5 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
(template_expr
(quoted_template
(quoted_template_start)
(quoted_template_end))))))))))))
(quoted_template_end)))))))))
(block_end))))

View File

@@ -13,6 +13,7 @@ foo = [1, 2, "foo"]
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(numeric_lit)))
@@ -24,7 +25,8 @@ foo = [1, 2, "foo"]
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))))
(quoted_template_end))))
(tuple_end)))))))
================================================================================
multiline tuple
@@ -45,6 +47,7 @@ foo = [
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(numeric_lit)))
@@ -56,7 +59,8 @@ foo = [
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))))
(quoted_template_end))))
(tuple_end)))))))
================================================================================
empty tuple
@@ -72,7 +76,9 @@ foo = []
(identifier)
(expression
(collection_value
(tuple))))))
(tuple
(tuple_start)
(tuple_end)))))))
================================================================================
multiline empty tuple
@@ -89,7 +95,9 @@ foo = [
(identifier)
(expression
(collection_value
(tuple))))))
(tuple
(tuple_start)
(tuple_end)))))))
================================================================================
object
@@ -106,6 +114,7 @@ foo = {1: 2, "foo"="bar"}
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(literal_value
@@ -125,7 +134,8 @@ foo = {1: 2, "foo"="bar"}
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))))
(quoted_template_end)))))
(object_end)))))))
================================================================================
multiline object
@@ -145,6 +155,7 @@ foo = {
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(literal_value
@@ -164,7 +175,8 @@ foo = {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))))
(quoted_template_end)))))
(object_end)))))))
================================================================================
empty object
@@ -180,7 +192,9 @@ foo = { }
(identifier)
(expression
(collection_value
(object))))))
(object
(object_start)
(object_end)))))))
================================================================================
multiline empty object
@@ -197,7 +211,9 @@ foo = {
(identifier)
(expression
(collection_value
(object))))))
(object
(object_start)
(object_end)))))))
================================================================================
multiline object weird newlines
@@ -217,6 +233,7 @@ foo = { 1: 2,
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(literal_value
@@ -236,7 +253,8 @@ foo = { 1: 2,
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))))
(quoted_template_end)))))
(object_end)))))))
================================================================================
complex object
@@ -256,6 +274,7 @@ foo = {
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(variable_expr
@@ -275,7 +294,8 @@ foo = {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))))
(quoted_template_end)))))
(object_end)))))))
================================================================================
complex from real world
@@ -305,9 +325,11 @@ worker_groups = [
(expression
(collection_value
(tuple
(tuple_start)
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(variable_expr
@@ -342,16 +364,20 @@ worker_groups = [
(expression
(collection_value
(tuple
(tuple_start)
(expression
(variable_expr
(identifier))
(get_attr
(identifier))
(get_attr
(identifier))))))))))
(identifier)))
(tuple_end)))))
(object_end))))
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(variable_expr
@@ -379,17 +405,21 @@ worker_groups = [
(expression
(collection_value
(tuple
(tuple_start)
(expression
(variable_expr
(identifier))
(get_attr
(identifier))
(get_attr
(identifier)))))))
(identifier)))
(tuple_end)))))
(object_elem
(expression
(variable_expr
(identifier)))
(expression
(literal_value
(numeric_lit)))))))))))))
(numeric_lit))))
(object_end))))
(tuple_end)))))))

View File

@@ -13,11 +13,13 @@ foo = [for v in ["a", "b"]: v]
(expression
(for_expr
(for_tuple_expr
(tuple_start)
(for_intro
(identifier)
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(string_lit
@@ -29,10 +31,12 @@ foo = [for v in ["a", "b"]: v]
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))
(quoted_template_end))))
(tuple_end)))))
(expression
(variable_expr
(identifier)))))))))
(identifier)))
(tuple_end)))))))
================================================================================
for tuple expression with index
@@ -49,12 +53,14 @@ foo = [for i, v in ["a", "b"]: i]
(expression
(for_expr
(for_tuple_expr
(tuple_start)
(for_intro
(identifier)
(identifier)
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(string_lit
@@ -66,10 +72,12 @@ foo = [for i, v in ["a", "b"]: i]
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))
(quoted_template_end))))
(tuple_end)))))
(expression
(variable_expr
(identifier)))))))))
(identifier)))
(tuple_end)))))))
================================================================================
for tuple expression with predicate
@@ -86,12 +94,14 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
(expression
(for_expr
(for_tuple_expr
(tuple_start)
(for_intro
(identifier)
(identifier)
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(string_lit
@@ -109,7 +119,8 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))
(quoted_template_end))))
(tuple_end)))))
(expression
(variable_expr
(identifier)))
@@ -120,7 +131,8 @@ foo = [for i, v in ["a", "b", "c"]: v if pred(i)]
(function_arguments
(expression
(variable_expr
(identifier)))))))))))))
(identifier)))))))
(tuple_end)))))))
================================================================================
for object expression
@@ -137,12 +149,14 @@ foo = {for i, v in ["a", "b"]: v => i}
(expression
(for_expr
(for_object_expr
(object_start)
(for_intro
(identifier)
(identifier)
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(string_lit
@@ -154,13 +168,15 @@ foo = {for i, v in ["a", "b"]: v => i}
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))
(quoted_template_end))))
(tuple_end)))))
(expression
(variable_expr
(identifier)))
(expression
(variable_expr
(identifier)))))))))
(identifier)))
(object_end)))))))
================================================================================
for object expression 2
@@ -177,12 +193,14 @@ foo = {for i, v in ["a", "b"]: v => i...}
(expression
(for_expr
(for_object_expr
(object_start)
(for_intro
(identifier)
(identifier)
(expression
(collection_value
(tuple
(tuple_start)
(expression
(literal_value
(string_lit
@@ -194,11 +212,13 @@ foo = {for i, v in ["a", "b"]: v => i...}
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))))
(quoted_template_end))))
(tuple_end)))))
(expression
(variable_expr
(identifier)))
(expression
(variable_expr
(identifier)))
(ellipsis)))))))
(ellipsis)
(object_end)))))))

View File

@@ -18,6 +18,7 @@ provider "kubernetes" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -59,7 +60,8 @@ provider "kubernetes" {
(index
(legacy_index))
(get_attr
(identifier)))))))))))
(identifier))))))))
(block_end))))
================================================================================
example 2
@@ -111,6 +113,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
(body
(block
(identifier)
(block_start)
(body
(attribute
(identifier)
@@ -175,7 +178,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
(variable_expr
(identifier))
(get_attr
(identifier))))))))
(identifier)))))))
(block_end))
(block
(identifier)
(string_lit
@@ -186,6 +190,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -229,7 +234,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))
(quoted_template_end))))))
(block_end))
(block
(identifier)
(string_lit
@@ -240,6 +246,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -283,7 +290,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))
(quoted_template_end))))))
(block_end))
(block
(identifier)
(string_lit
@@ -294,6 +302,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -358,7 +367,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))
(quoted_template_end))))))
(block_end))
(block
(identifier)
(string_lit
@@ -369,6 +379,7 @@ resource "azurerm_storage_blob" "proxy_cert" {
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
(body
(attribute
(identifier)
@@ -445,7 +456,8 @@ resource "azurerm_storage_blob" "proxy_cert" {
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))
(quoted_template_end))))))
(block_end))))
================================================================================
example 3
@@ -494,6 +506,7 @@ locals {
(body
(block
(identifier)
(block_start)
(body
(attribute
(identifier)
@@ -530,4 +543,5 @@ locals {
(get_attr
(identifier)))))
(template_interpolation_end))
(quoted_template_end)))))))))
(quoted_template_end))))))
(block_end))))

View File

@@ -206,13 +206,15 @@ foo = "${ {a=b}[a] }"
(expression
(collection_value
(object
(object_start)
(object_elem
(expression
(variable_expr
(identifier)))
(expression
(variable_expr
(identifier))))))
(identifier))))
(object_end)))
(index
(new_index
(expression