2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
While Loop
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
|
|
|
|
while true {
|
2023-12-29 20:14:03 -05:00
|
|
|
output ("This is a bad idea...")
|
2023-10-18 17:52:56 -04:00
|
|
|
}
|
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 17:52:56 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05:00
|
|
|
(statement
|
|
|
|
(while
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(boolean)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-12-29 18:59:15 -05:00
|
|
|
(function_expression
|
2024-01-01 04:59:27 -05:00
|
|
|
(value
|
|
|
|
(built_in_value)))
|
2023-11-29 19:23:42 -05:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-31 05:51:37 -04:00
|
|
|
Nested While Loop
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-11-30 11:05:09 -05:00
|
|
|
while true {
|
|
|
|
while x > 0 {
|
2023-10-31 05:51:37 -04:00
|
|
|
x -= 1
|
|
|
|
}
|
2023-10-18 17:52:56 -04:00
|
|
|
}
|
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 17:52:56 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05: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)))))))))))))
|