diff options
Diffstat (limited to 'src/kompsos-pretty_print.adb')
| -rw-r--r-- | src/kompsos-pretty_print.adb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/kompsos-pretty_print.adb b/src/kompsos-pretty_print.adb index d1d89b8..62f27fa 100644 --- a/src/kompsos-pretty_print.adb +++ b/src/kompsos-pretty_print.adb @@ -124,14 +124,18 @@ package body Kompsos.Pretty_Print is (Item : in World) return String is - Result : SU.Unbounded_String; + Result : SU.Unbounded_String; + Scratch : World := Item; + Counter : Positive := 1; begin - if Item.Possibles.Is_Empty then + if not Scratch.Has_State (Counter) then return "States: N/A" & Latin.LF; end if; - for Index in Integer range Item.Possibles.First_Index .. Item.Possibles.Last_Index loop - SU.Append (Result, "State#" & Image (Index) & ":" & Latin.LF); - SU.Append (Result, Image (Item.Possibles.Constant_Reference (Index))); + loop + SU.Append (Result, "State#" & Image (Counter) & ":" & Latin.LF); + SU.Append (Result, Image (Scratch.Possibles.Constant_Reference (Counter))); + Counter := Counter + 1; + exit when not Scratch.Has_State (Counter); end loop; return SU.Slice (Result, 1, SU.Length (Result) - 1); end Image; |
