Skip to content

Commit ac44d2e

Browse files
authored
Merge pull request #4555 from BuckleScript/fix_4548
fix #4548 ghost location
2 parents 96c8bb0 + 1d12e5d commit ac44d2e

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

jscomp/syntax/bs_builtin_ppx.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
8383
let name = "emptyArray" in
8484
let unit : _ Asttypes.loc = {txt = Ast_literal.Lid.val_unit ; loc } in
8585
let open Ast_helper in
86-
Exp.let_ Nonrecursive
86+
Exp.let_ Nonrecursive ~loc
8787
[{pvb_pat =
8888
Pat.var {txt = name ; loc} ~loc ;
8989
pvb_expr =
9090
Exp.fun_ Nolabel None
9191
(Pat.construct unit None)
9292
(Exp.array [] ~attrs:[{txt = ""; loc}, PStr []]);
9393
pvb_loc = loc; pvb_attributes = []}]
94-
(Exp.apply
95-
(Exp.ident {txt = Lident name; loc})
94+
(Exp.apply ~loc
95+
(Exp.ident ~loc {txt = Lident name; loc})
9696
[Nolabel,
9797
Exp.construct unit None ~loc;
9898
])

lib/4.06.1/unstable/bspack.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4592,6 +4592,7 @@ let absolute_path s = (* This function could go into Filename *)
45924592
aux s
45934593

45944594
let show_filename file =
4595+
let file = if file = "_none_" then !input_name else file in
45954596
if !absname then absolute_path file else file
45964597

45974598
let print_filename ppf file =

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4863,6 +4863,7 @@ let absolute_path s = (* This function could go into Filename *)
48634863
aux s
48644864

48654865
let show_filename file =
4866+
let file = if file = "_none_" then !input_name else file in
48664867
if !absname then absolute_path file else file
48674868

48684869
let print_filename ppf file =
@@ -409918,16 +409919,16 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
409918409919
let name = "emptyArray" in
409919409920
let unit : _ Asttypes.loc = {txt = Ast_literal.Lid.val_unit ; loc } in
409920409921
let open Ast_helper in
409921-
Exp.let_ Nonrecursive
409922+
Exp.let_ Nonrecursive ~loc
409922409923
[{pvb_pat =
409923409924
Pat.var {txt = name ; loc} ~loc ;
409924409925
pvb_expr =
409925409926
Exp.fun_ Nolabel None
409926409927
(Pat.construct unit None)
409927409928
(Exp.array [] ~attrs:[{txt = ""; loc}, PStr []]);
409928409929
pvb_loc = loc; pvb_attributes = []}]
409929-
(Exp.apply
409930-
(Exp.ident {txt = Lident name; loc})
409930+
(Exp.apply ~loc
409931+
(Exp.ident ~loc {txt = Lident name; loc})
409931409932
[Nolabel,
409932409933
Exp.construct unit None ~loc;
409933409934
])

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4863,6 +4863,7 @@ let absolute_path s = (* This function could go into Filename *)
48634863
aux s
48644864

48654865
let show_filename file =
4866+
let file = if file = "_none_" then !input_name else file in
48664867
if !absname then absolute_path file else file
48674868

48684869
let print_filename ppf file =
@@ -409918,16 +409919,16 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
409918409919
let name = "emptyArray" in
409919409920
let unit : _ Asttypes.loc = {txt = Ast_literal.Lid.val_unit ; loc } in
409920409921
let open Ast_helper in
409921-
Exp.let_ Nonrecursive
409922+
Exp.let_ Nonrecursive ~loc
409922409923
[{pvb_pat =
409923409924
Pat.var {txt = name ; loc} ~loc ;
409924409925
pvb_expr =
409925409926
Exp.fun_ Nolabel None
409926409927
(Pat.construct unit None)
409927409928
(Exp.array [] ~attrs:[{txt = ""; loc}, PStr []]);
409928409929
pvb_loc = loc; pvb_attributes = []}]
409929-
(Exp.apply
409930-
(Exp.ident {txt = Lident name; loc})
409930+
(Exp.apply ~loc
409931+
(Exp.ident ~loc {txt = Lident name; loc})
409931409932
[Nolabel,
409932409933
Exp.construct unit None ~loc;
409933409934
])

lib/4.06.1/unstable/native_ppx.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4592,6 +4592,7 @@ let absolute_path s = (* This function could go into Filename *)
45924592
aux s
45934593

45944594
let show_filename file =
4595+
let file = if file = "_none_" then !input_name else file in
45954596
if !absname then absolute_path file else file
45964597

45974598
let print_filename ppf file =

lib/4.06.1/whole_compiler.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4536,6 +4536,7 @@ let absolute_path s = (* This function could go into Filename *)
45364536
aux s
45374537

45384538
let show_filename file =
4539+
let file = if file = "_none_" then !input_name else file in
45394540
if true then absolute_path file else file
45404541

45414542
let print_filename ppf file =
@@ -412466,16 +412467,16 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
412466412467
let name = "emptyArray" in
412467412468
let unit : _ Asttypes.loc = {txt = Ast_literal.Lid.val_unit ; loc } in
412468412469
let open Ast_helper in
412469-
Exp.let_ Nonrecursive
412470+
Exp.let_ Nonrecursive ~loc
412470412471
[{pvb_pat =
412471412472
Pat.var {txt = name ; loc} ~loc ;
412472412473
pvb_expr =
412473412474
Exp.fun_ Nolabel None
412474412475
(Pat.construct unit None)
412475412476
(Exp.array [] ~attrs:[{txt = ""; loc}, PStr []]);
412476412477
pvb_loc = loc; pvb_attributes = []}]
412477-
(Exp.apply
412478-
(Exp.ident {txt = Lident name; loc})
412478+
(Exp.apply ~loc
412479+
(Exp.ident ~loc {txt = Lident name; loc})
412479412480
[Nolabel,
412480412481
Exp.construct unit None ~loc;
412481412482
])

ocaml

Submodule ocaml updated from 4ff3edc to 270ab07

0 commit comments

Comments
 (0)