tree-sitter-tiger/test/corpus/control_flow.txt

43 lines
1.3 KiB
Plaintext
Raw Normal View History

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))))