From a21cc8153592700ae7cb2cdfbb24b377e096a22a Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Fri, 4 Dec 2020 20:17:43 +1100 Subject: Scan/Parse functions are now packages, tests broken with linker errors --- src/packrat-parsers.ads | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) (limited to 'src/packrat-parsers.ads') diff --git a/src/packrat-parsers.ads b/src/packrat-parsers.ads index 8d0ba68..93d06dd 100644 --- a/src/packrat-parsers.ads +++ b/src/packrat-parsers.ads @@ -24,8 +24,6 @@ package Packrat.Parsers is type Parser_Context is private; - Empty_Context : constant Parser_Context; - @@ -54,10 +52,16 @@ package Packrat.Parsers is Context : in out Parser_Context; Start : in Positive) return Combinator_Result; - procedure Parse - (Input : in Traits.Element_Array; - Context : in out Parser_Context; - Result : out Graphs.Parse_Graph); + package Parse_Parts is + + procedure Parse + (Input : in Traits.Element_Array; + Result : out Graphs.Parse_Graph); + + procedure Reset; + + end Parse_Parts; + generic with function Root @@ -65,10 +69,16 @@ package Packrat.Parsers is Context : in out Parser_Context; Start : in Positive) return Combinator_Result; - function Parse_Only - (Input : in Traits.Element_Array; - Context : in out Parser_Context) - return Graphs.Parse_Graph; + package Parse_Once is + + function Parse + (Input : in Traits.Element_Array) + return Graphs.Parse_Graph; + + procedure Reset; + + end Parse_Once; + generic with function Root @@ -76,10 +86,15 @@ package Packrat.Parsers is Context : in out Parser_Context; Start : in Positive) return Combinator_Result; - function Parse_With - (Input : in With_Input; - Context : in out Parser_Context) - return Graphs.Parse_Graph; + package Parse_With is + + function Parse + (Input : in With_Input) + return Graphs.Parse_Graph; + + procedure Reset; + + end Parse_With; @@ -125,10 +140,6 @@ package Packrat.Parsers is Start : in Positive) return Combinator_Result; - private - - Combo : Combinator := null; - end Redirect; -- cgit