From 06d18bc4df24b65df5e54eb3ee9e243ed35cb271 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 11 Mar 2023 22:33:18 +1300 Subject: Documentation for Map --- src/parcom.cr | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/parcom.cr') diff --git a/src/parcom.cr b/src/parcom.cr index 44a770c..aa7abba 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,19 +81,6 @@ module Parcom end end - class Map(T, V, U) < Parser(T, U) - def initialize(@p : Parser(T, V), &block : V -> U) - @f = block - end - - def parse(tokens : Tokens(T)) : Result(T, U) - result = @p.parse(tokens) - Result.new(result.tokens, @f.call(result.value)) - rescue ex : ParserFail - raise ParserFail.new("Map: #{ex.message}") - end - end - class Phrase(T, V) @p : Map(T, {V, Nil}, V) -- cgit v1.2.1