2022-06-01 20:18:10 +02:00
|
|
|
================================================================================
|
|
|
|
If then else
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
if 12 then 27 else 42
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(if_expression
|
|
|
|
condition: (integer_literal)
|
|
|
|
consequence: (integer_literal)
|
|
|
|
alternative: (integer_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
If then
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
if 12 then 27
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(if_expression
|
|
|
|
condition: (integer_literal)
|
|
|
|
consequence: (integer_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Dangling else
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
if 12 then if 27 then 42 else "nope"
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(if_expression
|
|
|
|
condition: (integer_literal)
|
|
|
|
consequence: (if_expression
|
|
|
|
condition: (integer_literal)
|
|
|
|
consequence: (integer_literal)
|
|
|
|
alternative: (string_literal))))
|
2022-06-01 20:19:56 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
While
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
while 12 do 27
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(while_expression
|
|
|
|
condition: (integer_literal)
|
|
|
|
body: (integer_literal)))
|