From: Brendan Hansen Date: Mon, 27 Jul 2020 14:50:28 +0000 (-0500) Subject: Small improvement to errors with use parameters X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=1d2acce68a0e512060e50dadec7874f126395545;p=onyx.git Small improvement to errors with use parameters --- diff --git a/onyx b/onyx index 202b8c35..b644cefb 100755 Binary files a/onyx and b/onyx differ diff --git a/progs/ufc.onyx b/progs/ufc.onyx index fb88f6ac..50cd18c1 100644 --- a/progs/ufc.onyx +++ b/progs/ufc.onyx @@ -64,6 +64,10 @@ dot :: proc (v: Vec2, u: Vec2) -> f32 { return v.x * u.x + v.y * u.y; } +asdf :: proc (use v: ^Vec2, use u: ^Vec2) -> f32 { + return x + x; +} + // SomeType :: enum (u32) { Value1, Value2 } diff --git a/src/onyxsymres.c b/src/onyxsymres.c index ff8586f6..f3fe21bf 100644 --- a/src/onyxsymres.c +++ b/src/onyxsymres.c @@ -365,7 +365,12 @@ static void symres_function(AstFunction* func) { fa->type_node = (*mem)->type_node; fa->expr = (AstTyped *) param; - symbol_introduce(semstate.curr_scope, (*mem)->token, (AstNode *) fa); + token_toggle_end((*mem)->token); + symbol_raw_introduce(semstate.curr_scope, + (*mem)->token->text, + param->token->pos, + (AstNode *) fa); + token_toggle_end((*mem)->token); } } }