diff options
author | Jed Barber <jjbarber@y7mail.com> | 2021-01-18 18:48:14 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2021-01-18 18:48:14 +1100 |
commit | 901c7e61278f16dc5c08cbebf74c2a816cd4b4b6 (patch) | |
tree | b391d3f78cd138dfc0a59fda3b5f14485d7d79e5 /src | |
parent | d588551014dfdc248c8ea97a95e987da254b9931 (diff) |
Separate_By and Separate_End_By now ignore Separator and Ender combinator results
Diffstat (limited to 'src')
-rw-r--r-- | src/packrat-parsers.adb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/packrat-parsers.adb b/src/packrat-parsers.adb index 7f7f7f1..ed0f3d3 100644 --- a/src/packrat-parsers.adb +++ b/src/packrat-parsers.adb @@ -1047,7 +1047,8 @@ package body Packrat.Parsers is return Combinator_Result is function Not_Empty_Item is new Not_Empty (Item); - function Sep_Seq is new Sequence_2 (Separator, Not_Empty_Item); + function Ignore_Sep is new Ignore (Separator); + function Sep_Seq is new Sequence_2 (Ignore_Sep, Not_Empty_Item); function Many_Sep_Seq is new Many (Sep_Seq, (if Minimum = 0 then Minimum else Minimum - 1)); function Full_Seq is new Sequence_2 (Not_Empty_Item, Many_Sep_Seq); @@ -1075,8 +1076,9 @@ package body Packrat.Parsers is (Context : in out Parser_Context) return Combinator_Result is + function Ignore_Ender is new Ignore (Ender); function Sep_By is new Separate_By (Item, Separator, Minimum); - function End_Seq is new Sequence_2 (Sep_By, Ender); + function End_Seq is new Sequence_2 (Sep_By, Ignore_Ender); begin return End_Seq (Input, Context, Start); end Actual; |