aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parcom/parser.cr2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parcom/parser.cr b/src/parcom/parser.cr
index 9e74845..3fe4746 100644
--- a/src/parcom/parser.cr
+++ b/src/parcom/parser.cr
@@ -160,6 +160,8 @@ module Parcom
# Calls this parser's parsing function with the given input stream.
def parse(tokens : Tokens(T)) : Result(T, U)
@f.call(tokens)
+ rescue ex : ParserFail
+ raise ParserFail.new("#{@name}: #{ex.message}")
end
# Same as `#parse`, but returns `nil` instead of