1
0
dust/tree-sitter-dust/corpus/maps.txt

108 lines
2.7 KiB
Plaintext

================================================================================
Simple Map
================================================================================
{ answer = 42 }
--------------------------------------------------------------------------------
(root
(statement
(expression
(value
(map
(identifier)
(statement
(expression
(value
(integer)))))))))
================================================================================
Map with Types
================================================================================
{
answer <num> = 42
stuff <[str]> = [ "some" "stuff" ]
}
--------------------------------------------------------------------------------
(root
(statement
(expression
(value
(map
(identifier)
(type_definition
(type))
(statement
(expression
(value
(integer))))
(identifier)
(type_definition
(type
(type)))
(statement
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(string))))))))))))
================================================================================
Nested Maps
================================================================================
x = {
y = {
foo = 'bar'
z = {
message = 'hiya'
}
}
f = 12
}
--------------------------------------------------------------------------------
(root
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(map
(identifier)
(statement
(expression
(value
(map
(identifier)
(statement
(expression
(value
(string))))
(identifier)
(statement
(expression
(value
(map
(identifier)
(statement
(expression
(value
(string))))))))))))
(identifier)
(statement
(expression
(value
(integer)))))))))))