From 2f38b9f1292d971826d540718855f63431029715 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Tue, 11 Sep 2018 12:32:26 -0400 Subject: [PATCH] Remove label from error raising helper --- compiler/src/lib/tiger/tiger_error.ml | 2 +- compiler/src/lib/tiger/tiger_error.mli | 2 +- compiler/src/lib/tiger/tiger_parser.mly | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/lib/tiger/tiger_error.ml b/compiler/src/lib/tiger/tiger_error.ml index eb2c177..9e0d16a 100644 --- a/compiler/src/lib/tiger/tiger_error.ml +++ b/compiler/src/lib/tiger/tiger_error.ml @@ -2,6 +2,6 @@ module Pos = Tiger_position exception T of string -let exn ~pos ~msg = +let exn ~pos msg = let msg = Printf.sprintf "Error: %s. In %s." msg (Pos.to_string pos) in raise (T msg) diff --git a/compiler/src/lib/tiger/tiger_error.mli b/compiler/src/lib/tiger/tiger_error.mli index 25072b4..1f0d0ce 100644 --- a/compiler/src/lib/tiger/tiger_error.mli +++ b/compiler/src/lib/tiger/tiger_error.mli @@ -1,3 +1,3 @@ exception T of string -val exn : pos:Tiger_position.t -> msg:string -> 'a +val exn : pos:Tiger_position.t -> string -> 'a diff --git a/compiler/src/lib/tiger/tiger_parser.mly b/compiler/src/lib/tiger/tiger_parser.mly index 78d56a0..f4fbff9 100644 --- a/compiler/src/lib/tiger/tiger_parser.mly +++ b/compiler/src/lib/tiger/tiger_parser.mly @@ -75,7 +75,7 @@ program: | exp EOF { $1 } - | error {Tiger_error.exn ~pos:(pos ()) ~msg:"invalid syntax"} + | error {Tiger_error.exn "invalid syntax" ~pos:(pos ())} ; exp: -- 2.20.1