aboutsummaryrefslogtreecommitdiff
path: root/lib/analyzer.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/analyzer.ml')
-rw-r--r--lib/analyzer.ml14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/analyzer.ml b/lib/analyzer.ml
index 7a64cab..da1adbf 100644
--- a/lib/analyzer.ml
+++ b/lib/analyzer.ml
@@ -23,13 +23,13 @@ let parse :
| Interpreter.InvalidSyntax -> "Invalid Syntax"
| Interpreter.UnrecoverableError -> "UnrecoverableError"
| Interpreter.MenhirCode c ->
- String.concat ""
- [
- String.trim @@ Parser_messages.message c;
- " (Error code ";
- string_of_int c;
- ")";
- ]
+ let message_content =
+ try Parser_messages.message c
+ with Not_found ->
+ String.concat "" [ "(Error code "; string_of_int c; ")" ]
+ in
+
+ String.concat "" [ String.trim @@ message_content ]
in
let report =
Qsp_syntax.Report.error (e.start_pos, e.end_pos) message