diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-14 14:25:11 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-14 14:25:11 +0000 |
| commit | a918df69269a39ef7350a645b5db025d66ecb18a (patch) | |
| tree | 4ecb93f26e7e3ee2e256dd215c214b966df2d905 /src/parser/parser_type.c | |
| parent | df70f5bea676eb27e0ada10116d62f8c242c03a1 (diff) | |
Moving from to for improved error handling.
Diffstat (limited to 'src/parser/parser_type.c')
| -rw-r--r-- | src/parser/parser_type.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parser/parser_type.c b/src/parser/parser_type.c index cc33d99..d39e498 100644 --- a/src/parser/parser_type.c +++ b/src/parser/parser_type.c @@ -399,7 +399,7 @@ Type *parse_type_base(ParserContext *ctx, Lexer *l) } char *arg_str = type_to_string(arg); - instantiate_generic(ctx, name, arg_str); + instantiate_generic(ctx, name, arg_str, t); char *clean_arg = sanitize_mangled_name(arg_str); char mangled[256]; @@ -455,7 +455,7 @@ Type *parse_type_base(ParserContext *ctx, Lexer *l) } if (lexer_next(l).type != TOK_RBRACKET) { - zpanic("Expected ] after array size"); + zpanic_at(lexer_peek(l), "Expected ] after array size"); } Type *arr = type_new(TYPE_ARRAY); @@ -467,7 +467,7 @@ Type *parse_type_base(ParserContext *ctx, Lexer *l) // Otherwise it's a slice [T] if (lexer_next(l).type != TOK_RBRACKET) { - zpanic("Expected ] in type"); + zpanic_at(lexer_peek(l), "Expected ] in type"); } // Register Slice @@ -505,7 +505,7 @@ Type *parse_type_base(ParserContext *ctx, Lexer *l) } if (lexer_next(l).type != TOK_RPAREN) { - zpanic("Expected ) in tuple"); + zpanic_at(lexer_peek(l), "Expected ) in tuple"); } register_tuple(ctx, sig); @@ -773,7 +773,7 @@ char *parse_embed(ParserContext *ctx, Lexer *l) Token t = lexer_next(l); if (t.type != TOK_STRING) { - zpanic("String required"); + zpanic_at(t, "String required"); } char fn[256]; strncpy(fn, t.start + 1, t.len - 2); @@ -782,7 +782,7 @@ char *parse_embed(ParserContext *ctx, Lexer *l) FILE *f = fopen(fn, "rb"); if (!f) { - zpanic("404: %s", fn); + zpanic_at(t, "404: %s", fn); } fseek(f, 0, SEEK_END); long len = ftell(f); |
