diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 20:10:10 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 20:10:10 +1300 |
| commit | 516b7c653d8395f0d75aa1f62ce1c9d88857bcf9 (patch) | |
| tree | bcdfda96b96078768cde1604c56cc021081a4d27 /src/parcom.cr | |
| parent | 2fd2348affc3f571f70aeaf212d1a8054bbbd79f (diff) | |
Documentation for AtMost
Diffstat (limited to 'src/parcom.cr')
| -rw-r--r-- | src/parcom.cr | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/parcom.cr b/src/parcom.cr index cc123fd..24fb76c 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,20 +81,6 @@ module Parcom end end - class AtMost(T, V) < Parser(T, Array(V)) - @p : Map(T, Array(V?), Array(V)) - - def initialize(i : Int, p : Parser(T, V)) - @p = Exactly.new(i, Optional.new(p)).map(&.compact) - end - - def parse(tokens : Tokens(T)) : Result(T, Array(V)) - @p.parse(tokens) - rescue ex : ParserFail - raise ParserFail.new("AtMost: #{ex.message}") - end - end - class Between(T, V) < Parser(T, Array(V)) @p : Map(T, {Array(V), Array(V)}, Array(V)) |
