From 901c7e61278f16dc5c08cbebf74c2a816cd4b4b6 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 18 Jan 2021 18:48:14 +1100 Subject: Separate_By and Separate_End_By now ignore Separator and Ender combinator results --- src/packrat-parsers.adb | 6 ++++-- 1 file 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; -- cgit