favor return over return _ (void return); newline/closing terminates
This commit is contained in:
@@ -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)))))))
|
||||
|
||||
Reference in New Issue
Block a user