functionize the name in the error

This commit is contained in:
Lesenechal Remi 2020-01-02 19:39:31 +01:00
parent 4d56a71bd1
commit a3a09dc0e5
2 changed files with 6 additions and 6 deletions

View File

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

View File

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