From 6bced91bd28f860d830dfda921ee5056ec93f48c Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Fri, 6 Feb 2026 17:19:26 +1300 Subject: Evaluation algorithm changed to inverted interleaved depth first search --- src/kompsos-pretty_print.adb | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src/kompsos-pretty_print.adb') diff --git a/src/kompsos-pretty_print.adb b/src/kompsos-pretty_print.adb index 2befe6d..328f467 100644 --- a/src/kompsos-pretty_print.adb +++ b/src/kompsos-pretty_print.adb @@ -112,21 +112,14 @@ package body Kompsos.Pretty_Print is is Result : SU.Unbounded_String; begin - if Item.Ctrl.Actual = null then + if Item.Binds.Is_Empty then SU.Append (Result, Latin.HT & "N/A" & Latin.LF); else - declare - Marker : State_Component_Access := Item.Ctrl.Actual; - begin - while Marker /= null loop - for Index in Valid_Count range Valid_Count'First .. Marker.Valid loop - SU.Append (Result, Latin.HT & - Image (Marker.Data (Index).Key) & " => " & - Image (Marker.Data (Index).Value) & Latin.LF); - end loop; - Marker := Marker.Next.Ctrl.Actual; - end loop; - end; + for Bind of Item.Binds loop + SU.Append (Result, Latin.HT & + Image (Bind.Key) & " => " & + Image (Bind.Value) & Latin.LF); + end loop; end if; return SU.To_String (Result); end Image; @@ -224,15 +217,6 @@ package body Kompsos.Pretty_Print is "n" & Image (Nodes.Element (This.Actual)) & " -> " & "n" & Image (Nodes.Element (This.Actual.Con_Goal.Actual)) & ";" & Latin.LF); end if; - when Recurse_Node => - SU.Append (Result, Latin.HT & - "n" & Image (Nodes.Element (This.Actual)) & " [label=""recurse""];" & Latin.LF); - Do_Structure_DOT (This.Actual.Rec_Goal, Nodes, Next, Result); - if Nodes.Contains (This.Actual.Rec_Goal.Actual) then - SU.Append (Result, Latin.HT & - "n" & Image (Nodes.Element (This.Actual)) & " -> " & - "n" & Image (Nodes.Element (This.Actual.Rec_Goal.Actual)) & ";" & Latin.LF); - end if; end case; end Do_Structure_DOT; -- cgit