favor return over return _ (void return); newline/closing terminates

This commit is contained in:
2026-07-14 19:07:37 +02:00
parent eac5b32738
commit 471896b48a
19 changed files with 92266 additions and 94923 deletions
@@ -154,3 +154,56 @@ work func() i32 ! Failure {
(return_statement
(expression
(integer)))))))
==================
Bare return and value yield
==================
done func() void {
return
}
inline func() void { return }
choose func() i32 {
result :: { yield 1 }
return result
}
---
(source_file
(function_declaration
(identifier)
(parameter_list)
(type
(builtin_type))
(block
(statement
(return_statement))))
(function_declaration
(identifier)
(parameter_list)
(type
(builtin_type))
(block
(statement
(return_statement))))
(function_declaration
(identifier)
(parameter_list)
(type
(builtin_type))
(block
(statement
(constant_declaration
(identifier)
(block
(statement
(yield_statement
(expression
(integer)))))))
(statement
(return_statement
(expression
(identifier)))))))