From f6fe7980390fb9af67a207fd89abee05ed951397 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Mon, 13 Mar 2023 19:47:21 +1300 Subject: Documentation for Exactly --- src/parcom.cr | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/parcom.cr') diff --git a/src/parcom.cr b/src/parcom.cr index 4bfed1c..2e2d417 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,21 +81,6 @@ module Parcom end end - class Exactly(T, V) < Parser(T, Array(V)) - @p : Sequence(T, V) - - def initialize(i : Int, p : Parser(T, V)) - i = i.negative? ? 0 : i - @p = Sequence.new(([p] of Parser(T, V)) * i) - end - - def parse(tokens : Tokens(T)) : Result(T, Array(V)) - @p.parse(tokens) - rescue ex : ParserFail - raise ParserFail.new("Exactly: #{ex.message}") - end - end - class AtLeast(T, V) < Parser(T, Array(V)) @p : Map(T, {Array(V), Array(V)}, Array(V)) -- cgit v1.2.1