From: Siraaj Khandkar Date: Tue, 11 Sep 2018 16:32:26 +0000 (-0400) Subject: Remove label from error raising helper X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=commitdiff_plain;h=2f38b9f1292d971826d540718855f63431029715 Remove label from error raising helper --- 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: