From 478b2d7444429165952f3dbca8737b0e464db0e7 Mon Sep 17 00:00:00 2001 From: Damian Tarnawski Date: Mon, 29 Jul 2024 22:14:42 +0200 Subject: [PATCH] Correct the Array_Type.len comment and assign tok when making Ellipsis node --- core/odin/ast/ast.odin | 2 +- core/odin/parser/parser.odin | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/odin/ast/ast.odin b/core/odin/ast/ast.odin index 0ae822e21..31e8fdd53 100644 --- a/core/odin/ast/ast.odin +++ b/core/odin/ast/ast.odin @@ -757,7 +757,7 @@ Array_Type :: struct { using node: Expr, open: tokenizer.Pos, tag: ^Expr, - len: ^Expr, // Ellipsis node for [?]T array types, nil for slice types + len: ^Expr, // Unary_Expr node for [?]T array types, nil for slice types close: tokenizer.Pos, elem: ^Expr, } diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index 4d045f785..24c85a19e 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -1778,6 +1778,7 @@ parse_var_type :: proc(p: ^Parser, flags: ast.Field_Flags) -> ^ast.Expr { type = ast.new(ast.Bad_Expr, tok.pos, end_pos(tok)) } e := ast.new(ast.Ellipsis, type.pos, type) + e.tok = tok.kind e.expr = type return e }