suicmez/error_test/parser/control_flow_errors.sui

44 lines
653 B
Text
Raw Permalink Normal View History

2025-12-15 21:18:25 +05:30
# Control flow errors
# Missing condition in if
fn test() -> int
if
42
else
0
# Missing body in if
fn test() -> int
if true
else
0
# Missing variable in for loop
fn test() -> int
for in [1, 2, 3]
item
# Missing 'in' keyword in for loop
fn test() -> int
for item [1, 2, 3]
item
# Missing iterable in for loop
fn test() -> int
for item in
item
# Invalid while syntax
fn test() -> int
while
42
# Missing parameters in lambda
fn test() -> int
let f = lambda
42
# Missing closing parenthesis in lambda
fn test() -> int
let f = lambda(x
x