Use consistent separator for test files
This commit is contained in:
parent
3b2796d9ad
commit
7e4aeebc0d
2 changed files with 0 additions and 0 deletions
143
test/corpus/control-flow.txt
Normal file
143
test/corpus/control-flow.txt
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
================================================================================
|
||||
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))))
|
||||
|
||||
================================================================================
|
||||
While
|
||||
================================================================================
|
||||
|
||||
while 12 do 27
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(while_expression
|
||||
condition: (integer_literal)
|
||||
body: (integer_literal)))
|
||||
|
||||
================================================================================
|
||||
For
|
||||
================================================================================
|
||||
|
||||
for i := 12 to nil do "42"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(for_expression
|
||||
index: (identifier)
|
||||
(operator)
|
||||
start: (integer_literal)
|
||||
end: (nil_literal)
|
||||
body: (string_literal)))
|
||||
|
||||
================================================================================
|
||||
For no index
|
||||
================================================================================
|
||||
|
||||
for 12 to nil do "42"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(ERROR
|
||||
(identifier)
|
||||
(identifier)
|
||||
(nil_literal))
|
||||
(string_literal))
|
||||
|
||||
================================================================================
|
||||
For no end
|
||||
================================================================================
|
||||
|
||||
for 12 do "42"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(ERROR
|
||||
(identifier)
|
||||
(identifier))
|
||||
(string_literal))
|
||||
|
||||
================================================================================
|
||||
For no body
|
||||
================================================================================
|
||||
|
||||
for 12 to nil
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(ERROR
|
||||
(identifier)
|
||||
(identifier))
|
||||
(nil_literal))
|
||||
|
||||
================================================================================
|
||||
Break
|
||||
================================================================================
|
||||
|
||||
break
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(break_expression))
|
||||
|
||||
================================================================================
|
||||
Break in loops
|
||||
================================================================================
|
||||
|
||||
for i := break to break do while break do break
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(for_expression
|
||||
(identifier)
|
||||
(operator)
|
||||
(break_expression)
|
||||
(break_expression)
|
||||
(while_expression
|
||||
(break_expression)
|
||||
(break_expression))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue