diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 19:39:34 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 19:39:34 +1300 |
| commit | ddcf7c598e3cf5b1239d4e0045f7cf9374366427 (patch) | |
| tree | 89fd30dbc0f5683428ae7e3d958e3484b87f4ded /src/parcom.cr | |
| parent | 48ea163f12653a709b575f4c26b8348ef53ae0d5 (diff) | |
Documentation for TokenSeq
Diffstat (limited to 'src/parcom.cr')
| -rw-r--r-- | src/parcom.cr | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/parcom.cr b/src/parcom.cr index b6e6c3b..4bfed1c 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,23 +81,6 @@ module Parcom end end - class TokenSeq(T) < Parser(T, Array(T)) - @p : Sequence(T, T) - - def initialize(expected : Iterable(T)) - ps = [] of Parser(T, T) - expected.each { |t| ps << Token.new(t) } - - @p = Sequence.new(ps) - end - - def parse(tokens : Tokens(T)) : Result(T, Array(T)) - @p.parse(tokens) - rescue ex : ParserFail - raise ParserFail.new("TokenSeq: #{ex.message}") - end - end - class Exactly(T, V) < Parser(T, Array(V)) @p : Sequence(T, V) |
