add the name of the variable in the unbound variable error message title

This commit is contained in:
Lesenechal Remi 2020-01-02 19:30:09 +01:00
parent 3b73a7a5c8
commit 3288696784
2 changed files with 6 additions and 4 deletions

View File

@ -23,10 +23,11 @@ module Errors = struct
error ~data title message ()
let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () =
let title = (thunk "unbound variable") in
let name = Format.asprintf "%a" Stage_common.PP.name n in
let title = (thunk ("unbound variable "^name)) in
let message () = "" in
let data = [
("variable" , fun () -> Format.asprintf "%a" Stage_common.PP.name n) ;
("variable" , fun () -> name) ;
("environment" , fun () -> Format.asprintf "%a" Environment.PP.full_environment e) ;
("location" , fun () -> Format.asprintf "%a" Location.pp loc)
] in

View File

@ -30,10 +30,11 @@ module Errors = struct
error ~data title message ()
let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () =
let title = (thunk "unbound variable") in
let name = Format.asprintf "%a" Stage_common.PP.name n in
let title = (thunk ("unbound variable "^name)) in
let message () = "" in
let data = [
("variable" , fun () -> Format.asprintf "%a" Stage_common.PP.name n) ;
("variable" , fun () -> name) ;
("environment" , fun () -> Format.asprintf "%a" Environment.PP.full_environment e) ;
("location" , fun () -> Format.asprintf "%a" Location.pp loc)
] in