aboutsummaryrefslogtreecommitdiff
path: root/src/parcom.cr
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-13 19:47:21 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-13 19:47:21 +1300
commitf6fe7980390fb9af67a207fd89abee05ed951397 (patch)
tree0567d8d68536e70b2ce6b89df03818a8624611ad /src/parcom.cr
parentddcf7c598e3cf5b1239d4e0045f7cf9374366427 (diff)
Documentation for Exactly
Diffstat (limited to 'src/parcom.cr')
-rw-r--r--src/parcom.cr15
1 files changed, 0 insertions, 15 deletions
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))