summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2021-01-13 18:57:43 +1100
committerJed Barber <jjbarber@y7mail.com>2021-01-13 18:57:43 +1100
commitea022446ea40844831a7daa3c6e6d9f7d91c01f2 (patch)
tree2ce93933f8a8584cec295e3f9b300ebda819ef85
parent3fa431a2268a11dec6fd82c8f9b59cc2d0af9a93 (diff)
Removed superfluous Line_End/Input_End lexer combinators
-rw-r--r--src/packrat-lexers.adb33
-rw-r--r--src/packrat-lexers.ads17
-rw-r--r--test/rat_tests-lexers.adb47
-rw-r--r--test/rat_tests-lexers.ads7
4 files changed, 1 insertions, 103 deletions
diff --git a/src/packrat-lexers.adb b/src/packrat-lexers.adb
index bf5d109..cd81635 100644
--- a/src/packrat-lexers.adb
+++ b/src/packrat-lexers.adb
@@ -687,39 +687,6 @@ package body Packrat.Lexers is
end Take_Until;
-
-
-
- function Line_End
- (Input : in Traits.Element_Array;
- Start : in Positive)
- return Combinator_Result is
- begin
- if Start > Input'Last then
- return Empty_Fail;
- elsif Input (Start) = EOL_Item then
- return (Start, Success);
- else
- return Empty_Fail;
- end if;
- end Line_End;
-
-
- function Input_End
- (Input : in Traits.Element_Array;
- Start : in Positive)
- return Combinator_Result is
- begin
- if Start > Input'Last then
- return Empty_Fail;
- elsif Input (Start) = EOF_Item then
- return (Start, Success);
- else
- return Empty_Fail;
- end if;
- end Input_End;
-
-
end Packrat.Lexers;
diff --git a/src/packrat-lexers.ads b/src/packrat-lexers.ads
index ac0ba2b..4b6bbc9 100644
--- a/src/packrat-lexers.ads
+++ b/src/packrat-lexers.ads
@@ -268,23 +268,6 @@ package Packrat.Lexers is
return Combinator_Result;
-
-
- generic
- EOL_Item : in Traits.Element_Type;
- function Line_End
- (Input : in Traits.Element_Array;
- Start : in Positive)
- return Combinator_Result;
-
- generic
- EOF_Item : in Traits.Element_Type;
- function Input_End
- (Input : in Traits.Element_Array;
- Start : in Positive)
- return Combinator_Result;
-
-
private
diff --git a/test/rat_tests-lexers.adb b/test/rat_tests-lexers.adb
index 15a5d6f..6d8c34f 100644
--- a/test/rat_tests-lexers.adb
+++ b/test/rat_tests-lexers.adb
@@ -480,53 +480,6 @@ package body Rat_Tests.Lexers is
end Take_Until_Check;
- function Line_End_Check
- return Test_Result
- is
- function LF_End is new Slexy.Line_End (Latin.LF);
- function C_End is new Slexy.Line_End ('c');
-
- Test_Str : String := "abcd" & Latin.LF & "e";
-
- Result1 : Slexy.Combinator_Result :=
- Slebug.Create_Result (5, Packrat.Success);
- Result2 : Slexy.Combinator_Result :=
- Slebug.Create_Result (3, Packrat.Success);
- Result3 : Slexy.Combinator_Result := Slebug.Empty_Fail;
- begin
- if LF_End (Test_Str, 5) /= Result1 or C_End (Test_Str, 3) /= Result2 or
- LF_End (Test_Str, Test_Str'Last + 5) /= Result3 or LF_End (Test_Str, 1) /= Result3
- then
- return Fail;
- end if;
- return Pass;
- end Line_End_Check;
-
-
- function Input_End_Check
- return Test_Result
- is
- function C_End is new Slexy.Input_End ('c');
- function E_End is new Slexy.Input_End ('e');
-
- Test_Str : String := "abcde";
-
- Result1 : Slexy.Combinator_Result :=
- Slebug.Create_Result (5, Packrat.Success);
- Result2 : Slexy.Combinator_Result :=
- Slebug.Create_Result (3, Packrat.Success);
- Result3 : Slexy.Combinator_Result := Slebug.Empty_Fail;
- begin
- if C_End (Test_Str, 3) /= Result2 or E_End (Test_Str, 5) /= Result1 or
- C_End (Test_Str, 6) /= Result3 or E_End (Test_Str, 6) /= Result3 or
- C_End (Test_Str, 1) /= Result3 or E_End (Test_Str, Test_Str'Last + 5) /= Result3
- then
- return Fail;
- end if;
- return Pass;
- end Input_End_Check;
-
-
diff --git a/test/rat_tests-lexers.ads b/test/rat_tests-lexers.ads
index af9b221..5c10005 100644
--- a/test/rat_tests-lexers.ads
+++ b/test/rat_tests-lexers.ads
@@ -39,9 +39,6 @@ package Rat_Tests.Lexers is
function Take_While_Check return Test_Result;
function Take_Until_Check return Test_Result;
- function Line_End_Check return Test_Result;
- function Input_End_Check return Test_Result;
-
Combinator_Tests : Test_Array :=
((+"Join", Join_Check'Access),
(+"Equals", Equals_Check'Access),
@@ -56,9 +53,7 @@ package Rat_Tests.Lexers is
(+"Multimatch", Multimatch_Check'Access),
(+"Take", Take_Check'Access),
(+"Take While", Take_While_Check'Access),
- (+"Take Until", Take_Until_Check'Access),
- (+"Line End", Line_End_Check'Access),
- (+"Input_End", Input_End_Check'Access));
+ (+"Take Until", Take_Until_Check'Access));
function Stamp_Check return Test_Result;