From 97be6f4ca3f35b0999a36d647716f77c0300d5d7 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Thu, 30 Mar 2023 22:27:01 +1300 Subject: Replace overloads of flunk with a default argument --- src/parcom/parser.cr | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/parcom/parser.cr b/src/parcom/parser.cr index 7a06f53..9e74845 100644 --- a/src/parcom/parser.cr +++ b/src/parcom/parser.cr @@ -37,17 +37,12 @@ module Parcom end # Creates a parser that always fails with the given error message. - def self.flunk(message : String) : Parser(T, U) + def self.flunk(message : String = "Flunked parser") : Parser(T, U) Parser(T, U).new("Flunk") do |_| raise ParserFail.new(message) end end - # Creates a parser that always fails. - def self.flunk : Parser(T, U) - flunk("Flunked parser") - end - # Creates a parser that returns the first token in the input stream. # Fails if the input stream is empty. # Analagous to a '.' in a regular expression. -- cgit v1.2.1