From 6c296b5615699eac0fb569b5cfe29e96986904a5 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 28 Nov 2020 14:24:02 +1100 Subject: Skeleton of Packrat.Parsers --- src/packrat.adb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/packrat.adb (limited to 'src/packrat.adb') diff --git a/src/packrat.adb b/src/packrat.adb new file mode 100644 index 0000000..8c1c463 --- /dev/null +++ b/src/packrat.adb @@ -0,0 +1,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; + + -- cgit