From 350aae53131d70979108023ab0ac11379e024011 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 11 Mar 2023 18:35:54 +1300 Subject: Rename Eof to EOF + documentation --- src/parcom.cr | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/parcom.cr') diff --git a/src/parcom.cr b/src/parcom.cr index f6d1e05..4612887 100644 --- a/src/parcom.cr +++ b/src/parcom.cr @@ -81,16 +81,6 @@ module Parcom end end - class Eof(T) < Parser(T, Nil) - def parse(tokens : Tokens(T)) : Result(T, Nil) - if tokens.empty? - Result.new(tokens, nil) - else - raise ParserFail.new("Eof: input was not empty") - end - end - end - class Peek(T, V) < Parser(T, V) def initialize(@p : Parser(T, V)) end @@ -179,7 +169,7 @@ module Parcom @p : Map(T, {V, Nil}, V) def initialize(p : Parser(T, V)) - @p = (p + Eof(T).new).map &.first + @p = (p + EOF(T).new).map &.first end def parse(tokens : Tokens(T)) : Result(T, V) -- cgit v1.2.1