158 lines
3.4 KiB
Plaintext
158 lines
3.4 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)
|
|
(property
|
|
(identifier)
|
|
(integer_literal))))
|
|
|
|
================================================================================
|
|
Single property (trailing comma)
|
|
================================================================================
|
|
|
|
foo {
|
|
bar: 42,
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(module
|
|
(identifier)
|
|
(property
|
|
(identifier)
|
|
(integer_literal))))
|
|
|
|
================================================================================
|
|
Mixed values
|
|
================================================================================
|
|
|
|
foo {
|
|
active: true,
|
|
value: "foo",
|
|
answer: 42,
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(module
|
|
(identifier)
|
|
(property
|
|
(identifier)
|
|
(boolean_literal))
|
|
(property
|
|
(identifier)
|
|
(interpreted_string_literal))
|
|
(property
|
|
(identifier)
|
|
(integer_literal))))
|
|
|
|
================================================================================
|
|
Complex value
|
|
================================================================================
|
|
|
|
foo {
|
|
some: [
|
|
{
|
|
complex: "value",
|
|
}
|
|
],
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(module
|
|
(identifier)
|
|
(property
|
|
(identifier)
|
|
(list_expression
|
|
(map_expression
|
|
(property
|
|
(identifier)
|
|
(interpreted_string_literal)))))))
|
|
|
|
================================================================================
|
|
Multiple modules
|
|
================================================================================
|
|
|
|
foo {
|
|
answer: 42,
|
|
value: "test",
|
|
}
|
|
|
|
bar {
|
|
baz: "qux",
|
|
done: true,
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(module
|
|
(identifier)
|
|
(property
|
|
(identifier)
|
|
(integer_literal))
|
|
(property
|
|
(identifier)
|
|
(interpreted_string_literal)))
|
|
(module
|
|
(identifier)
|
|
(property
|
|
(identifier)
|
|
(interpreted_string_literal))
|
|
(property
|
|
(identifier)
|
|
(boolean_literal))))
|
|
|
|
================================================================================
|
|
Rogue comma
|
|
================================================================================
|
|
|
|
foo {
|
|
,
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(module
|
|
(identifier)
|
|
(ERROR)))
|