Eliminate some spurious synonyms of "location"

This commit is contained in:
Tom Jack 2019-12-30 15:24:42 -06:00
parent e73c901135
commit 6716af9123
3 changed files with 21 additions and 21 deletions

View File

@ -24,7 +24,7 @@ module Errors = struct
let message () = "" in let message () = "" in
let expression_loc = AST.expr_to_region expr in let expression_loc = AST.expr_to_region expr in
let data = [ let data = [
("expression_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ expression_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ expression_loc)
] in ] in
error ~data title message error ~data title message
@ -37,7 +37,7 @@ module Errors = struct
~stop:(Pos.from_byte end_) ~stop:(Pos.from_byte end_)
in in
let data = [ let data = [
("parser_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ loc fun () -> Format.asprintf "%a" Location.pp_lift @@ loc
) )
] in ] in
@ -51,7 +51,7 @@ module Errors = struct
~stop:(Pos.from_byte end_) ~stop:(Pos.from_byte end_)
in in
let data = [ let data = [
("unrecognized_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ loc fun () -> Format.asprintf "%a" Location.pp_lift @@ loc
) )
] in ] in

View File

@ -32,7 +32,7 @@ module Errors = struct
in in
let data = [ let data = [
("expected", fun () -> expected_name); ("expected", fun () -> expected_name);
("actual_loc" , fun () -> Format.asprintf "%a" Location.pp_lift @@ Raw.pattern_to_region actual) ("location" , fun () -> Format.asprintf "%a" Location.pp_lift @@ Raw.pattern_to_region actual)
] in ] in
error ~data title message error ~data title message
@ -43,7 +43,7 @@ module Errors = struct
List.fold_left (fun a p -> Region.cover a (Raw.pattern_to_region p)) List.fold_left (fun a p -> Region.cover a (Raw.pattern_to_region p))
Region.ghost patterns in Region.ghost patterns in
let data = [ let data = [
("loc", fun () -> Format.asprintf "%a" Location.pp_lift @@ patterns_loc) ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ patterns_loc)
] in ] in
error ~data title message error ~data title message
@ -52,7 +52,7 @@ module Errors = struct
let message () = let message () =
Format.asprintf "unknown predefined type \"%s\"" name.Region.value in Format.asprintf "unknown predefined type \"%s\"" name.Region.value in
let data = [ let data = [
("typename_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region) fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region)
] in ] in
error ~data title message error ~data title message
@ -63,7 +63,7 @@ module Errors = struct
Format.asprintf "untyped function parameters are not supported yet" in Format.asprintf "untyped function parameters are not supported yet" in
let param_loc = var.Region.region in let param_loc = var.Region.region in
let data = [ let data = [
("param_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ param_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ param_loc)
] in ] in
error ~data title message error ~data title message
@ -74,7 +74,7 @@ module Errors = struct
Format.asprintf "tuple patterns are not supported yet" in Format.asprintf "tuple patterns are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -85,7 +85,7 @@ module Errors = struct
Format.asprintf "constant constructors are not supported yet" in Format.asprintf "constant constructors are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -97,7 +97,7 @@ module Errors = struct
are not supported yet" in are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -119,7 +119,7 @@ module Errors = struct
Format.asprintf "currently, only constructors are supported in patterns" in Format.asprintf "currently, only constructors are supported in patterns" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -130,7 +130,7 @@ module Errors = struct
Format.asprintf "currently, only empty lists and constructors (::) \ Format.asprintf "currently, only empty lists and constructors (::) \
are supported in patterns" in are supported in patterns" in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ region) fun () -> Format.asprintf "%a" Location.pp_lift @@ region)
] in ] in
error ~data title message error ~data title message

View File

@ -72,7 +72,7 @@ module Errors = struct
Format.asprintf "constant constructors are not supported yet" in Format.asprintf "constant constructors are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -104,7 +104,7 @@ module Errors = struct
let message () = let message () =
Format.asprintf "unknown predefined type \"%s\"" name.Region.value in Format.asprintf "unknown predefined type \"%s\"" name.Region.value in
let data = [ let data = [
("typename_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region) fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region)
] in ] in
error ~data title message error ~data title message
@ -116,7 +116,7 @@ module Errors = struct
are not supported yet" in are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -127,7 +127,7 @@ module Errors = struct
Format.asprintf "currently, only constructors are supported in patterns" in Format.asprintf "currently, only constructors are supported in patterns" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -138,7 +138,7 @@ module Errors = struct
Format.asprintf "tuple patterns are not supported yet" in Format.asprintf "tuple patterns are not supported yet" in
let pattern_loc = Raw.pattern_to_region p in let pattern_loc = Raw.pattern_to_region p in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ; fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ;
(** TODO: The labelled arguments should be flowing from the CLI. *) (** TODO: The labelled arguments should be flowing from the CLI. *)
("pattern", ("pattern",
@ -154,7 +154,7 @@ module Errors = struct
in patterns are supported" in in patterns are supported" in
let pattern_loc = Raw.pattern_to_region pattern in let pattern_loc = Raw.pattern_to_region pattern in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc)
] in ] in
error ~data title message error ~data title message
@ -165,7 +165,7 @@ module Errors = struct
Format.asprintf "currently, only empty lists and x::y \ Format.asprintf "currently, only empty lists and x::y \
are supported in patterns" in are supported in patterns" in
let data = [ let data = [
("pattern_loc", ("location",
fun () -> Format.asprintf "%a" Location.pp_lift @@ cons.Region.region) fun () -> Format.asprintf "%a" Location.pp_lift @@ cons.Region.region)
] in ] in
error ~data title message error ~data title message
@ -174,7 +174,7 @@ module Errors = struct
let title () = "unexpected anonymous function" in let title () = "unexpected anonymous function" in
let message () = "you provided a function declaration without name" in let message () = "you provided a function declaration without name" in
let data = [ let data = [
("loc" , fun () -> Format.asprintf "%a" Location.pp @@ loc) ("location" , fun () -> Format.asprintf "%a" Location.pp @@ loc)
] in ] in
error ~data title message error ~data title message
@ -182,7 +182,7 @@ module Errors = struct
let title () = "unexpected named function" in let title () = "unexpected named function" in
let message () = "you provided a function expression with a name (remove it)" in let message () = "you provided a function expression with a name (remove it)" in
let data = [ let data = [
("loc" , fun () -> Format.asprintf "%a" Location.pp @@ loc) ("location" , fun () -> Format.asprintf "%a" Location.pp @@ loc)
] in ] in
error ~data title message error ~data title message