summaryrefslogtreecommitdiff
path: root/src/packrat.adb
blob: 32cb88f61b65d29e9cf7f1f1c5163ab68bd8bfed (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
29
30
31


--  This source is licensed under the Sunset License v1.0


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;