tree-sitter-bp/test/corpus/modules.txt

117 lines
2.6 KiB
Plaintext
Raw Normal View History

2024-04-08 02:36:27 +02:00
================================================================================
Empty module
================================================================================
foo{}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)))
================================================================================
Empty module (newlines)
================================================================================
foo {
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)))
================================================================================
Single property
================================================================================
foo {
bar: 42
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)
(identifier)
(integer_literal)))
================================================================================
Single property (trailing comma)
================================================================================
foo {
bar: 42,
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)
(identifier)
(integer_literal)))
================================================================================
Mixed values
================================================================================
foo {
active: true,
value: "foo",
answer: 42,
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)
(identifier)
(boolean_literal)
(identifier)
(interpreted_string_literal)
(identifier)
(integer_literal)))
================================================================================
Complex value
================================================================================
foo {
some: [
{
complex: "value",
}
],
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)
(identifier)
(list_expression
(map_expression
(identifier)
(interpreted_string_literal)))))
================================================================================
Rogue comma
================================================================================
foo {
,
}
--------------------------------------------------------------------------------
(source_file
(module
(identifier)
(ERROR)))