Skip to content

Commit

Permalink
Remove extra block
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-y committed Sep 4, 2024
1 parent 60ce403 commit 50ca933
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion std/macros.void
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ pub macro fn()
body.slice(type_arrow_index + 2)
else: body.slice(1)

let fn_body =
if expressions.length == 1 then:
expressions.extract(0)
else:
`(block).concat(expressions)

`(
define_function,
$identifier,
$params,
(return_type $@return_type),
$(`(block).concat(expressions))
$fn_body
)

pub macro def_wasm_operator(op, wasm_fn, arg_type, return_type)
Expand Down

0 comments on commit 50ca933

Please sign in to comment.