Files
tree-sitter-jhcl/test/corpus/blocks.txt

142 lines
3.3 KiB
Plaintext
Raw Normal View History

================================================================================
2021-06-08 23:06:04 +02:00
basic block
================================================================================
2021-06-08 23:06:04 +02:00
block_1 {
}
--------------------------------------------------------------------------------
2021-06-08 23:06:04 +02:00
(config_file
(body
(block
(identifier))))
2021-06-08 23:06:04 +02:00
================================================================================
2021-06-08 23:06:04 +02:00
basic block on one line
================================================================================
2021-06-08 23:06:04 +02:00
block_1 {}
--------------------------------------------------------------------------------
2021-06-08 23:06:04 +02:00
(config_file
(body
(block
(identifier))))
================================================================================
2021-06-08 23:06:04 +02:00
block with attribute
================================================================================
2021-06-08 23:06:04 +02:00
block_1 "strlit1" "strlit2" {
attr1 = "val1"
}
--------------------------------------------------------------------------------
2021-06-08 23:06:04 +02:00
(config_file
(body
(block
(identifier)
(string_lit
(template_literal))
(string_lit
(template_literal))
2021-06-08 23:06:04 +02:00
(body
(attribute
(identifier)
(expression
(literal_value
(string_lit
(template_literal)))))))))
2021-06-08 23:06:04 +02:00
================================================================================
2021-06-08 23:06:04 +02:00
nested block
================================================================================
2021-06-08 23:06:04 +02:00
block_1 {
block_2 {
}
}
--------------------------------------------------------------------------------
2021-06-08 23:06:04 +02:00
(config_file
(body
(block
(identifier)
(body
(block
(identifier))))))
2021-06-08 23:06:04 +02:00
================================================================================
2021-06-08 23:06:04 +02:00
nested block on one line
================================================================================
2021-06-08 23:06:04 +02:00
block_1 {
block_2 {}
}
--------------------------------------------------------------------------------
2021-06-08 23:06:04 +02:00
(config_file
(body
(block
(identifier)
(body
(block
(identifier))))))
2021-06-08 23:18:50 +02:00
================================================================================
2021-06-08 23:18:50 +02:00
nested blocks
================================================================================
2021-06-08 23:18:50 +02:00
block_1 {
block_2 {}
block_3 {}
}
--------------------------------------------------------------------------------
2021-06-08 23:18:50 +02:00
(config_file
(body
(block
(identifier)
(body
(block
(identifier))
(block
(identifier))))))
2021-06-19 21:01:03 +02:00
================================================================================
one line block
================================================================================
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
--------------------------------------------------------------------------------
(config_file
(body
(block
2021-06-19 21:01:03 +02:00
(identifier)
(body
(attribute
2021-06-19 21:01:03 +02:00
(identifier)
(expression
(function_call
(identifier)
(function_arguments
(expression
(function_call
(identifier)))
(expression
(literal_value
(string_lit
(template_literal))))
(expression
(template_expr
(quoted_template)))))))))))