nightshade

The nightshade programming language, compiler and tools (WIP)
Log | Files | Refs | README

commit d4c3f486a7aad29db296477f82dd3bf46a2bf7cf
parent 3b65c14fc4876b58cab2405175f34e1047f49ede
Author: citbl <citbl@citbl.org>
Date:   Tue, 16 Jun 2026 17:54:56 +1000

wip hide lowering for now

Diffstat:
Msrc/ast_lower.adb | 7++++---
Msrc/ast_lower.ads | 1+
Msrc/nightshade.adb | 7-------
3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/ast_lower.adb b/src/ast_lower.adb @@ -22,12 +22,13 @@ package body AST_Lower is function Init (File_Name : File_Name_Ref; Source : Source_Ref; AST : Declaration_Vectors.Vector) return Lowerer is begin - return Lowerer'(File_Name => File_Name, Source => Source, AST => AST, Module => null); + return Lowerer'(File_Name => File_Name, Source => Source, AST => AST, Module => null, Pos => 0); end Init; function Lower_Expr(LL : in out Lowerer; Expr : Expr) return IR_Value is begin - + LL.Pos := LL.Pos + 1; + return IR_Value'(Id => LL.Pos, Typ => IR_Void); end; function Lower_Call(LL : in out Lowerer; Call : Call_Expr) return IR_Instruction is @@ -48,7 +49,7 @@ package body AST_Lower is T := IR_VOID; end if; - for SS : Stmt in Func.Stmts loop + for SS : Stmt of Func.Stmts loop if SS.Kind = Stmt_Call then Lower_Call(LL, SS.Call); end if; diff --git a/src/ast_lower.ads b/src/ast_lower.ads @@ -55,6 +55,7 @@ package AST_Lower is Source : Source_Ref; AST : Declaration_Vectors.Vector; Module : IR_Module_Ref; + Pos : Natural; end record; function Init diff --git a/src/nightshade.adb b/src/nightshade.adb @@ -6,7 +6,6 @@ with Lexer; with Parser; with AST_Scoper; with AST_Typer; -with AST_Lower; procedure Nightshade is begin @@ -40,12 +39,6 @@ begin TypedAST : AST_Typer.Typer := AST_Typer.Init (P.AST); begin AST_Typer.Type_Check (TypedAST); - - declare - Lowered : AST_Lower.Lowerer := AST_Lower.Init(File_Name_Ref, Src_Ref, P.AST); - begin - AST_Lower.Print_IR(Lowered); - end; end; end; end;