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

66 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2023-10-31 19:21:13 +00:00
================================================================================
While Loop
2023-10-31 19:21:13 +00:00
================================================================================
while true {
(output "This is a bad idea...")
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(while
(expression
(value
(boolean)))
(block
(statement
(expression
(function_call
2023-12-02 07:34:23 +00:00
(expression
2023-12-11 16:17:37 +00:00
(identifier
(built_in_function)))
2023-11-30 00:23:42 +00:00
(expression
(value
(string))))))))))
2023-10-31 19:21:13 +00:00
================================================================================
2023-10-31 09:51:37 +00:00
Nested While Loop
2023-10-31 19:21:13 +00:00
================================================================================
2023-11-30 16:05:09 +00:00
while true {
while x > 0 {
2023-10-31 09:51:37 +00:00
x -= 1
}
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-11-11 01:44:03 +00:00
(statement
(while
(expression
(value
(boolean)))
(block
(statement
(while
(expression
(logic
(expression
(identifier))
(logic_operator)
(expression
(value
(integer)))))
(block
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(integer)))))))))))))