aboutsummaryrefslogtreecommitdiff
path: root/src/parcom.cr
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-13 20:22:07 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-13 20:22:07 +1300
commit6e4c12589c58b41cf748b1913823df71cec7215f (patch)
tree45dd779761acc39c0eaa63a1b2c1bf426f488ba7 /src/parcom.cr
parent516b7c653d8395f0d75aa1f62ce1c9d88857bcf9 (diff)
Documentation for Between
Diffstat (limited to 'src/parcom.cr')
-rw-r--r--src/parcom.cr18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/parcom.cr b/src/parcom.cr
index 24fb76c..0170fdc 100644
--- a/src/parcom.cr
+++ b/src/parcom.cr
@@ -81,24 +81,6 @@ module Parcom
end
end
- class Between(T, V) < Parser(T, Array(V))
- @p : Map(T, {Array(V), Array(V)}, Array(V))
-
- def initialize(i : Int, j : Int, p : Parser(T, V))
- lower = i < j ? i : j
- upper = (i - j).abs
- @p = (Exactly.new(lower, p) + AtMost.new(upper, p)).map do |tup|
- tup[0] + tup[1]
- end
- end
-
- def parse(tokens : Tokens(T)) : Result(T, Array(V))
- @p.parse(tokens)
- rescue ex : ParserFail
- raise ParserFail.new("Between: #{ex.message}")
- end
- end
-
class FirstOf(T, V) < Parser(T, V)
@p : Parser(T, V)