summaryrefslogtreecommitdiff
path: root/test/rat_tests-lexers.ads
diff options
context:
space:
mode:
Diffstat (limited to 'test/rat_tests-lexers.ads')
-rw-r--r--test/rat_tests-lexers.ads51
1 files changed, 49 insertions, 2 deletions
diff --git a/test/rat_tests-lexers.ads b/test/rat_tests-lexers.ads
index fe6cca8..6c8a4d7 100644
--- a/test/rat_tests-lexers.ads
+++ b/test/rat_tests-lexers.ads
@@ -1,7 +1,19 @@
-with Unit_Tests;
-use Unit_Tests;
+with
+
+ Unit_Tests;
+
+use
+
+ Unit_Tests;
+
+private with
+
+ Packrat.Errors,
+ Packrat.Traits,
+ Packrat.Lexers.Debug,
+ Packrat.Utilities;
package Rat_Tests.Lexers is
@@ -76,6 +88,41 @@ package Rat_Tests.Lexers is
(+"Scan_Set_With Exception", Scan_Set_With_Error_Check'Access));
+private
+
+
+ package PU renames Packrat.Utilities;
+
+
+ type My_Labels is (One, Two, Three);
+
+
+ package Slexy_Traits is new Packrat.Traits (My_Labels, Character, String);
+ package Slexy is new Packrat.Lexers (Slexy_Traits);
+ package Slebug is new Slexy.Debug;
+
+
+ use type Slexy.Combinator_Result;
+
+
+ type Word_Enum is (Blank, Word, Whitespace);
+
+ package Swordy_Traits is new Packrat.Traits (Word_Enum, Character, String);
+ package Swordy is new Packrat.Lexers (Swordy_Traits);
+ package Swolbug is new Swordy.Debug;
+
+ use type Swordy_Traits.Tokens.Token_Type;
+ use type Swordy_Traits.Tokens.Token_Array;
+
+ function Satisfy_Letter is new Swordy.Satisfy (PU.Is_Letter);
+ function Many_Letter is new Swordy.Many (Satisfy_Letter, 1);
+ function Satisfy_Whitespace is new Swordy.Satisfy (PU.Is_Whitespace);
+ function Many_Whitespace is new Swordy.Many (Satisfy_Whitespace, 1);
+
+ function Stamp_Word is new Swordy.Stamp (Word, Many_Letter);
+ function Ignore_Whitespace is new Swordy.Ignore (Whitespace, Many_Whitespace);
+
+
end Rat_Tests.Lexers;