commit 7c0cd1ddf4fb5c815f22e6baad86e61d9b7d3424
parent 4f6cee9ee4b62275df8aa9038930a2673d6eb4f6
Author: citbl <citbl@citbl.org>
Date: Sat, 13 Jun 2026 21:55:00 +1000
cleanup
Diffstat:
3 files changed, 6 insertions(+), 37 deletions(-)
diff --git a/src/binder.adb b/src/binder.adb
@@ -39,7 +39,7 @@ package body Binder is
(Return_Type => Void_Type, Params => new Type_List'(1 => String_Type)));
begin
Put_Line ("load std symbols");
- Info := (Kind => SYM_FUNC, Typ => Print_Type);
+ Info := (Name => To_Unbounded_String("print"), Kind => SYM_FUNC, Typ => Print_Type);
S.Scope.Symbols.Include ("print", Info);
end;
diff --git a/src/binder.ads b/src/binder.ads
@@ -40,6 +40,7 @@ package Binder is
--------------------------------
type Symbol_Info is record
+ Name : Unbounded_String;
Kind : Symbol_Kind_Enum;
Typ : Type_Info_Ref;
end record;
diff --git a/src/parser.ads b/src/parser.ads
@@ -5,38 +5,6 @@ with Lexer; use Lexer;
package Parser is
- type Node_Kind is
- (NODE_PROGRAM,
- NODE_FUNCTION_DECL,
- NODE_STRUCT_DECL,
- NODE_STRUCT_IMPL,
- NODE_PARAM,
- NODE_VAR_DECL,
- NODE_VAR_ASSIGN,
- NODE_FIELD_DECL,
- NODE_FIELD_IMPL,
- NODE_METHOD_DECL,
- NODE_BLOCK,
- NODE_CALL_EXPR,
- NODE_RETURN,
- NODE_BREAK,
- NODE_CONTINUE,
- NODE_INT_LITERAL,
- NODE_FLOAT_LITERAL,
- NODE_STRING_LITERAL,
- NODE_BOOL_LITERAL,
- NODE_IDENT,
- NODE_TYPE,
- NODE_BINARY_EXPR,
- NODE_UNARY_EXPR,
- NODE_EXPR_Stmt,
- NODE_SUBSCRIPT_EXPR,
- NODE_IF,
- NODE_WHILE,
- NODE_FOR,
- NODE_EMPTY_Stmt,
- NODE_UNKNOWN);
-
type Param is record
Name : Unbounded_String;
Kind : Unbounded_String;
@@ -127,11 +95,11 @@ package Parser is
Ada.Containers.Indefinite_Vectors (Index_Type => Natural, Element_Type => Decl);
type Parser is record
- Source : Source_Ref;
- File_Name : File_Name_Ref;
- Tokens : Lexer.Token_Vector.Vector;
+ Source : Source_Ref;
+ File_Name : File_Name_Ref;
+ Tokens : Lexer.Token_Vector.Vector;
Declarations : Declaration_Vectors.Vector;
- Pos : Positive;
+ Pos : Positive;
end record;
function Init