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

120 lines
3.3 KiB
Plaintext

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