From 6716af91233344d87cd8021060ff76c22adb5c47 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Mon, 30 Dec 2019 15:24:42 -0600 Subject: [PATCH] Eliminate some spurious synonyms of "location" --- src/passes/1-parser/reasonligo.ml | 6 +++--- src/passes/2-simplify/cameligo.ml | 18 +++++++++--------- src/passes/2-simplify/pascaligo.ml | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/passes/1-parser/reasonligo.ml b/src/passes/1-parser/reasonligo.ml index 77c2e8e42..dbf28b756 100644 --- a/src/passes/1-parser/reasonligo.ml +++ b/src/passes/1-parser/reasonligo.ml @@ -24,7 +24,7 @@ module Errors = struct let message () = "" in let expression_loc = AST.expr_to_region expr in let data = [ - ("expression_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ expression_loc) ] in error ~data title message @@ -37,7 +37,7 @@ module Errors = struct ~stop:(Pos.from_byte end_) in let data = [ - ("parser_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ loc ) ] in @@ -51,7 +51,7 @@ module Errors = struct ~stop:(Pos.from_byte end_) in let data = [ - ("unrecognized_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ loc ) ] in diff --git a/src/passes/2-simplify/cameligo.ml b/src/passes/2-simplify/cameligo.ml index 7dbb027d7..5be02f4bf 100644 --- a/src/passes/2-simplify/cameligo.ml +++ b/src/passes/2-simplify/cameligo.ml @@ -32,7 +32,7 @@ module Errors = struct in let data = [ ("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 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)) Region.ghost patterns in let data = [ - ("loc", fun () -> Format.asprintf "%a" Location.pp_lift @@ patterns_loc) + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ patterns_loc) ] in error ~data title message @@ -52,7 +52,7 @@ module Errors = struct let message () = Format.asprintf "unknown predefined type \"%s\"" name.Region.value in let data = [ - ("typename_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region) ] in error ~data title message @@ -63,7 +63,7 @@ module Errors = struct Format.asprintf "untyped function parameters are not supported yet" in let param_loc = var.Region.region in let data = [ - ("param_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ param_loc) ] in error ~data title message @@ -74,7 +74,7 @@ module Errors = struct Format.asprintf "tuple patterns are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -85,7 +85,7 @@ module Errors = struct Format.asprintf "constant constructors are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -97,7 +97,7 @@ module Errors = struct are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -119,7 +119,7 @@ module Errors = struct Format.asprintf "currently, only constructors are supported in patterns" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -130,7 +130,7 @@ module Errors = struct Format.asprintf "currently, only empty lists and constructors (::) \ are supported in patterns" in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ region) ] in error ~data title message diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 0707ee85a..4f9e92deb 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -72,7 +72,7 @@ module Errors = struct Format.asprintf "constant constructors are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -104,7 +104,7 @@ module Errors = struct let message () = Format.asprintf "unknown predefined type \"%s\"" name.Region.value in let data = [ - ("typename_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ name.Region.region) ] in error ~data title message @@ -116,7 +116,7 @@ module Errors = struct are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -127,7 +127,7 @@ module Errors = struct Format.asprintf "currently, only constructors are supported in patterns" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -138,7 +138,7 @@ module Errors = struct Format.asprintf "tuple patterns are not supported yet" in let pattern_loc = Raw.pattern_to_region p in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ; (** TODO: The labelled arguments should be flowing from the CLI. *) ("pattern", @@ -154,7 +154,7 @@ module Errors = struct in patterns are supported" in let pattern_loc = Raw.pattern_to_region pattern in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ] in error ~data title message @@ -165,7 +165,7 @@ module Errors = struct Format.asprintf "currently, only empty lists and x::y \ are supported in patterns" in let data = [ - ("pattern_loc", + ("location", fun () -> Format.asprintf "%a" Location.pp_lift @@ cons.Region.region) ] in error ~data title message @@ -174,7 +174,7 @@ module Errors = struct let title () = "unexpected anonymous function" in let message () = "you provided a function declaration without name" in let data = [ - ("loc" , fun () -> Format.asprintf "%a" Location.pp @@ loc) + ("location" , fun () -> Format.asprintf "%a" Location.pp @@ loc) ] in error ~data title message @@ -182,7 +182,7 @@ module Errors = struct let title () = "unexpected named function" in let message () = "you provided a function expression with a name (remove it)" in let data = [ - ("loc" , fun () -> Format.asprintf "%a" Location.pp @@ loc) + ("location" , fun () -> Format.asprintf "%a" Location.pp @@ loc) ] in error ~data title message