-
This commit is contained in:
@@ -159,7 +159,7 @@ fn (mut g Generator) gen_expr(expr Expr) {
|
|||||||
g.out.write_string(mangle_var(expr.name))
|
g.out.write_string(mangle_var(expr.name))
|
||||||
}
|
}
|
||||||
UnaryExpr {
|
UnaryExpr {
|
||||||
g.out.write_string('${expr.ident}${expr.op}')
|
g.out.write_string('(${mangle_var(expr.ident)}${expr.op})')
|
||||||
}
|
}
|
||||||
BinaryExpr {
|
BinaryExpr {
|
||||||
g.out.write_string('(')
|
g.out.write_string('(')
|
||||||
|
|||||||
2
parser.v
2
parser.v
@@ -638,6 +638,8 @@ fn (mut p Parser) parse_func_decl() FuncDecl {
|
|||||||
else{parse_error("Expected function return type after name when declaring ${name_tok.text}")}
|
else{parse_error("Expected function return type after name when declaring ${name_tok.text}")}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.symbols.define_func(name_tok.text, type_tok.text, Block{})
|
||||||
|
|
||||||
block := p.parse_block(true)
|
block := p.parse_block(true)
|
||||||
|
|
||||||
return_stmts := p.get_return_stmts_recursive(block)
|
return_stmts := p.get_return_stmts_recursive(block)
|
||||||
|
|||||||
Reference in New Issue
Block a user