nightshade

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

commit 2eaf7a08ca0ed48a72d361f880476bc657a5d914
parent 93b2c041d34f89260c86c4d89c1fe77bcbe2dafc
Author: citbl <citbl@citbl.org>
Date:   Wed,  1 Jul 2026 17:32:50 +1000

minor

Diffstat:
Msrc/gen.adb | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/gen.adb b/src/gen.adb @@ -11,20 +11,28 @@ package body Gen is (AST => AST, Globals => To_Unbounded_String (""), Output => To_Unbounded_String (""), Indent => 0); end; + ----------------- -- gen unident -- + ----------------- procedure Gen_Unindent (GG : in out Generator) is begin GG.Indent := GG.Indent - 4; end; + --------------- -- gen ident -- + --------------- procedure Gen_Indent (GG : in out Generator) is begin GG.Indent := GG.Indent + 4; end; + ---------------- + -- put indent -- + ---------------- + procedure Put_Indent (GG : in out Generator) is begin GG.Output := GG.Output & To_Unbounded_String (GG.Indent * ' '); @@ -37,13 +45,13 @@ package body Gen is procedure Gen_Call (GG : in out Generator; Call : in Call_Expr) is begin - -- if Call.Params.Length /= 1 then - -- raise Program_error with "cannot handle calls of more or less than 1 param yet"; - -- end if; declare Param : constant Expr_Ref := Call.Params.Element (Call.Params.First_Index); Content : Unbounded_String := Param.Lit_Str; begin + -- if Call.Params.Length /= 1 then + -- raise Program_error with "cannot handle calls of more or less than 1 param yet"; + -- end if; GG.Globals := GG.GLobals & "data $str = { b " & (Content) & ", b 0 }" & ASCII.LF; Put_Indent (GG); GG.Output := GG.Output & "%r =w call $puts(l $str)" & ASCII.LF;