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

73 lines
1.9 KiB
Plaintext

================================================================================
Simple For Loop
================================================================================
for i in [1, 2, 3] {
output(i)
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(for
(identifier)
(expression
(value
(list
(expression
(value
(integer)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(block
(statement
(statement_kind
(expression
(function_call
(function_expression
(identifier))
(expression
(identifier)))))))))))
================================================================================
Nested For Loop
================================================================================
for list in list_of_lists {
for item in list {
output(item)
}
}
--------------------------------------------------------------------------------
(root
(statement
(statement_kind
(for
(identifier)
(expression
(identifier))
(block
(statement
(statement_kind
(for
(identifier)
(expression
(identifier))
(block
(statement
(statement_kind
(expression
(function_call
(function_expression
(identifier))
(expression
(identifier)))))))))))))))