diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 19:52:52 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 19:52:52 +1300 |
| commit | 2fd2348affc3f571f70aeaf212d1a8054bbbd79f (patch) | |
| tree | 2e5027120c6a7a086ae8bee1feb1658e702dd4f4 /src/parcom.cr | |
| parent | f6fe7980390fb9af67a207fd89abee05ed951397 (diff) | |
Documentation for AtLeast
Diffstat (limited to 'src/parcom.cr')
| -rw-r--r-- | src/parcom.cr | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/parcom.cr b/src/parcom.cr index 2e2d417..cc123fd 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,22 +81,6 @@ module Parcom end end - class AtLeast(T, V) < Parser(T, Array(V)) - @p : Map(T, {Array(V), Array(V)}, Array(V)) - - def initialize(i : Int, p : Parser(T, V)) - @p = (Exactly.new(i, p) + Many.new(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("AtLeast: #{ex.message}") - end - end - class AtMost(T, V) < Parser(T, Array(V)) @p : Map(T, Array(V?), Array(V)) |
