aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parcom/parser.cr7
1 files changed, 1 insertions, 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.