Files
tree-sitter-jhcl/test/corpus/blocks.txt
mhoffm 380571cc1a * add field names to object elements
* dont hide template interpolation start/end and quoted template start/end tokens
2021-07-02 08:34:28 +02:00

152 lines
3.7 KiB
Plaintext

================================================================================
basic block
================================================================================
block_1 {
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier))))
================================================================================
basic block on one line
================================================================================
block_1 {}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier))))
================================================================================
block with attribute
================================================================================
block_1 "strlit1" "strlit2" {
attr1 = "val1"
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))
(body
(attribute
(identifier)
(expression
(literal_value
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end)))))))))
================================================================================
nested block
================================================================================
block_1 {
block_2 {
}
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(body
(block
(identifier))))))
================================================================================
nested block on one line
================================================================================
block_1 {
block_2 {}
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(body
(block
(identifier))))))
================================================================================
nested blocks
================================================================================
block_1 {
block_2 {}
block_3 {}
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(body
(block
(identifier))
(block
(identifier))))))
================================================================================
one line block
================================================================================
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(body
(attribute
(identifier)
(expression
(function_call
(identifier)
(function_arguments
(expression
(function_call
(identifier)))
(expression
(literal_value
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))
(expression
(template_expr
(quoted_template
(quoted_template_start)
(quoted_template_end))))))))))))