summaryrefslogtreecommitdiff
path: root/src/packrat.adb
blob: 8c1c463d6174a529fa9f955ed068055a40b712d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


package body Packrat is


    function Array_Less_Than
           (Left, Right : in Array_Type)
        return Boolean
    is
        Left_Index : Positive := Left'First;
        Right_Index : Positive := Right'First;
    begin
        while Left_Index <= Left'Last and Right_Index <= Right'Last loop
            if Left (Left_Index) < Right (Right_Index) then
                return True;
            elsif Left (Left_Index) /= Right (Right_Index) then
                return False;
            end if;
            Left_Index := Left_Index + 1;
            Right_Index := Right_Index + 1;
        end loop;
        return Left'Length < Right'Length;
    end Array_Less_Than;


end Packrat;