aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-31 22:09:05 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-31 22:09:05 +1300
commit5d023a1ed0419e63615e41fd14004373e44f87ed (patch)
treebc549dc2fc737d9681e39f86f88b41ddd8f73e9c /src
parentfdfce3d4c7a672fdff10e91bf5a4808cd4d46c4d (diff)
More informative error messages
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