tree-sitter-bp/test/corpus/modules.txt
2024-04-08 20:15:59 +01:00

117 lines
2.6 KiB
Plaintext

================================================================================
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)))