commit e0745f0500fa255357bb08de421fc3fcf6016334 parent 97eebbc7d3893d46deaf5e720cce897a70731789 Author: citbl <citbl@citbl.org> Date: Fri, 29 May 2026 23:41:43 +1000 lexer wip Diffstat:
| M | src/lexer.adb | | | 20 | +++++++++++++++++--- |
| M | src/nightshade.adb | | | 3 | +-- |
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/lexer.adb b/src/lexer.adb @@ -15,12 +15,26 @@ package body Lexer is end Init; procedure Lex (L : in out Lexer) is - SRC : constant String := To_String (L.Source); + SRC : constant String := To_String (L.Source); + I : Positive := SRC'First; + I2 : Positive := 1; + Line : Positive := 1; + Col : Positive := 1; + C : Character; begin Put_Line (Natural'Image (Length (L.Source))); - for C of SRC loop - Put_Line (C'Image); + + while I <= SRC'Last loop + if I < SRC'Last then + I2 := I + 1; + else + I2 := I; + end if; + C := SRC (I); + + I := I + 1; end loop; + end; end Lexer; diff --git a/src/nightshade.adb b/src/nightshade.adb @@ -17,8 +17,7 @@ begin File_Contents : constant String := Utils.Load_Contents (File_Name); L : Lexer.Lexer := Lexer.Init (File_Name, File_Contents); begin - -- Put_Line (File_Contents); Lexer.Lex (L); - Put_Line ("done?"); + Put_Line ("done"); end; end Nightshade;