2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
While Loop
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
while true {
|
2023-12-30 01:14:03 +00:00
|
|
|
output ("This is a bad idea...")
|
2023-10-18 21:52:56 +00:00
|
|
|
}
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
2023-11-30 00:23:42 +00:00
|
|
|
(expression
|
2024-02-16 15:55:15 +00:00
|
|
|
(function_call
|
|
|
|
(function_expression
|
|
|
|
(identifier))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
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-10-18 21:52:56 +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-18 21:52:56 +00:00
|
|
|
}
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(while
|
2023-11-11 01:44:03 +00:00
|
|
|
(expression
|
2024-02-16 15:55:15 +00:00
|
|
|
(logic
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(logic_operator)
|
2023-11-11 01:44:03 +00:00
|
|
|
(expression
|
|
|
|
(value
|
2024-02-16 15:55:15 +00:00
|
|
|
(integer)))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))))))))))))))
|