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

193 lines
4.6 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)
(block_start)
(block_end))))
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)
(block_start)
(block_end))))
2021-06-08 23:06:04 +02:00
2022-06-02 19:14:44 +02:00
================================================================================
basic block with empty type
================================================================================
block_1 "" {
}
--------------------------------------------------------------------------------
(config_file
(body
(block
(identifier)
(string_lit
(quoted_template_start)
(quoted_template_end))
(block_start)
(block_end))))
================================================================================
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
(quoted_template_start)
(template_literal)
(quoted_template_end))
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))
(block_start)
2021-06-08 23:06:04 +02:00
(body
(attribute
(identifier)
(expression
(literal_value
(string_lit
(quoted_template_start)
(template_literal)
(quoted_template_end))))))
(block_end))))
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)
(block_start)
2021-06-08 23:06:04 +02:00
(body
(block
(identifier)
(block_start)
(block_end)))
(block_end))))
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)
(block_start)
2021-06-08 23:06:04 +02:00
(body
(block
(identifier)
(block_start)
(block_end)))
(block_end))))
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)
(block_start)
2021-06-08 23:18:50 +02:00
(body
(block
(identifier)
(block_start)
(block_end))
2021-06-08 23:18:50 +02:00
(block
(identifier)
(block_start)
(block_end)))
(block_end))))
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)
(block_start)
(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
(quoted_template_start)
(template_literal)
(quoted_template_end))))
(expression
2022-06-02 19:14:44 +02:00
(literal_value
(string_lit
(quoted_template_start)
(quoted_template_end)))))))))
(block_end))))