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

68 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-10-31 19:21:13 +00:00
================================================================================
Simple For Loop
2023-10-31 19:21:13 +00:00
================================================================================
2023-11-11 01:44:03 +00:00
for i in [1, 2, 3] {
2023-11-15 00:22:26 +00:00
(output i)
2023-11-11 01:44:03 +00:00
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(for
(identifier)
(expression
(value
(list
(expression
2023-11-11 01:44:03 +00:00
(value
(integer)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(block
(statement
(expression
(function_call
2023-12-02 07:34:23 +00:00
(expression
(identifier))
2023-11-30 00:23:42 +00:00
(expression
(identifier)))))))))
2023-10-31 19:21:13 +00:00
================================================================================
2023-10-31 05:09:29 +00:00
Nested For Loop
2023-10-31 19:21:13 +00:00
================================================================================
2023-11-11 01:44:03 +00:00
for list in list_of_lists {
for item in list {
2023-11-15 00:22:26 +00:00
(output item)
2023-11-11 01:44:03 +00:00
}
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(for
(identifier)
(expression
(identifier))
(block
(statement
(for
(identifier)
(expression
(identifier))
(block
(statement
(expression
(function_call
2023-12-02 07:34:23 +00:00
(expression
(identifier))
2023-11-30 00:23:42 +00:00
(expression
(identifier))))))))))))