From 4aa7653f76f2223c41debdfdddf6a420d3f0db88 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 19 Apr 2020 22:57:34 +1000 Subject: Refactoring of Lexer Scan functions --- src/packrat-lexer.ads | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/packrat-lexer.ads') diff --git a/src/packrat-lexer.ads b/src/packrat-lexer.ads index 693064d..9973cdd 100644 --- a/src/packrat-lexer.ads +++ b/src/packrat-lexer.ads @@ -293,20 +293,19 @@ private - type Lexer_Context is new Ada.Finalization.Controlled with record + type Lexer_Context is record Result_So_Far : Token_Vectors.Vector; - Position : Positive; - Offset : Natural; - Status : Result_Status; + Position : Positive := 1; + Offset : Natural := 0; + Status : Result_Status := Success; Pass_Forward : Input_Holders.Holder; Empty_Labels : Label_Sets.Set; Error_Labels : Label_Vectors.Vector; - Allow_Incomplete : Boolean; + Allow_Incomplete : Boolean := True; end record; Empty_Context : constant Lexer_Context := - (Ada.Finalization.Controlled with - Result_So_Far => Token_Vectors.Empty_Vector, + (Result_So_Far => Token_Vectors.Empty_Vector, Position => 1, Offset => 0, Status => Success, @@ -316,6 +315,14 @@ private Allow_Incomplete => True); + + + procedure Internal_Scan_Core + (Input : in Element_Array; + Context : in out Lexer_Context; + Components : in Component_Array); + + end Packrat.Lexer; -- cgit