From 8e1f7f57bc08b98d95beead0630964baf913cc0d Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 29 Jan 2019 00:34:32 +1100 Subject: Clarified Cursor details in Packrat.Graphs, added test for Find --- src/packrat-graphs.adb | 6 +++--- src/packrat-graphs.ads | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/packrat-graphs.adb b/src/packrat-graphs.adb index 1206a89..1411259 100644 --- a/src/packrat-graphs.adb +++ b/src/packrat-graphs.adb @@ -471,7 +471,7 @@ package body Packrat.Graphs is begin return Result : Reversible_Iterator do Result.My_Container := This'Unrestricted_Access; - Result.My_Position := No_Position; + Result.My_Position := Cursor (No_Position); end return; end Iterate; @@ -483,7 +483,7 @@ package body Packrat.Graphs is begin return Result : Reversible_Iterator do Result.My_Container := This'Unrestricted_Access; - Result.My_Position := No_Position; + Result.My_Position := Cursor (No_Position); end return; end Iterate_Subtree; @@ -495,7 +495,7 @@ package body Packrat.Graphs is begin return Result : Forward_Iterator do Result.My_Container := This'Unrestricted_Access; - Result.My_Position := No_Position; + Result.My_Position := Cursor (No_Position); end return; end Iterate_Choice; diff --git a/src/packrat-graphs.ads b/src/packrat-graphs.ads index 877be3a..0ef298e 100644 --- a/src/packrat-graphs.ads +++ b/src/packrat-graphs.ads @@ -33,7 +33,7 @@ package Packrat.Graphs is - No_Position : constant Cursor; + No_Position : constant My_Interfaces.Cursor'Class; Empty_Graph : constant Parse_Graph; @@ -339,7 +339,8 @@ private No_Node : constant Node := (My_Interfaces.Node with null record); - No_Position : constant Cursor := (My_Interfaces.Cursor with null record); + No_Position_Actual : constant Cursor := (My_Interfaces.Cursor with null record); + No_Position : constant My_Interfaces.Cursor'Class := No_Position_Actual; Empty_Graph : constant Parse_Graph := (My_Interfaces.Graph with null record); -- cgit