summaryrefslogtreecommitdiff
path: root/src/packrat-errors.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/packrat-errors.adb')
-rw-r--r--src/packrat-errors.adb24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/packrat-errors.adb b/src/packrat-errors.adb
index 3f7c38f..0122b7d 100644
--- a/src/packrat-errors.adb
+++ b/src/packrat-errors.adb
@@ -313,6 +313,30 @@ package body Packrat.Errors is
end Decode;
+
+
+
+ function Equivalent
+ (Left, Right : in Error_Info_Array)
+ return Boolean
+ is
+ Marked : array (Left'Range) of Boolean := (others => False);
+ begin
+ if Left'Length /= Right'Length then
+ return False;
+ end if;
+ for L_Index in Left'Range loop
+ for R of Right loop
+ if Left (L_Index) = R and not Marked (L_Index) then
+ Marked (L_Index) := True;
+ exit;
+ end if;
+ end loop;
+ end loop;
+ return (for all M of Marked => M = True);
+ end Equivalent;
+
+
end Packrat.Errors;