Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[feature] compiler: extend error fun to take a msg optional argument

  • Loading branch information...
commit 210e57dc9733c38206e8d76db58ebc328c6b71b3 1 parent 1d44007
Niki Vazou authored
View
2  compiler/compilerlib/oManager.ml
@@ -235,7 +235,7 @@ module Error = struct
let add_warn_error warn =
warn_set := WarnSet.add warn !warn_set
- let error_fmt fmt = ("@{<red>Error@}@\n"^^fmt^^"@.")
+ let error_fmt fmt = ("@{<red>Error:@}"^^fmt^^"@.")
let print_public_error fmt =
printf (error_fmt fmt)
View
2  compiler/libbsl/bslError.mli
@@ -73,6 +73,6 @@ val i_serror : PassHandler.cond_id option -> context -> ('a, unit) OManager.ofor
(** Public Errors *)
(** *)
-val error : context -> ('params, 'exit) OManager.oformat -> 'params
+val error : ?msg:string -> context -> ('params, 'exit) OManager.oformat -> 'params
val serror : context -> ('params, unit) OManager.oformat -> 'params
val warning : wclass:WarningClass.wclass -> context -> ('params, unit) OManager.oformat -> 'params
View
2  compiler/libqmlcompil/qmlError.mli
@@ -115,6 +115,6 @@ val i_serror : PassHandler.cond_id option -> context -> ('a, unit) OManager.ofor
(** Public Errors *)
(** *)
-val error : context -> ('params, 'exit) OManager.oformat -> 'params
+val error : ?msg:string -> context -> ('params, 'exit) OManager.oformat -> 'params
val serror : context -> ('params, unit) OManager.oformat -> 'params
val warning : wclass:WarningClass.wclass -> context -> ('params, unit) OManager.oformat -> 'params
View
2  compiler/opalang/opaError.mli
@@ -78,6 +78,6 @@ val i_serror : PassHandler.cond_id option -> context -> ('a, unit) OManager.ofor
(** Public Errors *)
(** *)
-val error : context -> ('params, 'exit) OManager.oformat -> 'params
+val error : ?msg:string -> context -> ('params, 'exit) OManager.oformat -> 'params
val serror : context -> ('params, unit) OManager.oformat -> 'params
val warning : wclass:WarningClass.wclass -> context -> ('params, unit) OManager.oformat -> 'params
View
2  compiler/passes/surfaceAstRenaming.ml
@@ -416,7 +416,7 @@ let make_error error label fmt =
let context = OpaError.Context.pos (pos_of_label label) in
error context ("@[<2> "^^fmt^^"@]")
let serror label = make_error OpaError.serror label
-let error label = make_error OpaError.error label
+let error label = make_error (OpaError.error ~msg:"") label
let unbound kind name all_env label =
let string, names_in_scope =
match kind with
View
2  compiler/passlib/passError.ml
@@ -91,7 +91,7 @@ struct
(** Public errors *)
(** *)
- let error c fmt = OManager.error ("%a"^^fmt) C.console c
+ let error ?(msg="") c fmt = OManager.error ("%s@\n%a"^^fmt) msg C.console c
let serror c fmt = OManager.serror ("%a"^^fmt) C.console c
let warning ~wclass c fmt = OManager.warning ~wclass ("%a"^^fmt) C.console c
end
Please sign in to comment.
Something went wrong with that request. Please try again.