Skip to content

Commit 87717b9

Browse files
committed
change local to private which has a better syntax highlighting
1 parent 45fa4c0 commit 87717b9

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

jscomp/syntax/bs_builtin_ppx.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,16 @@ let rec
380380
| Pstr_extension ( ({txt = ("bs.raw"| "raw") ; loc}, payload), _attrs)
381381
->
382382
Ast_exp_handle_external.handle_raw_structure loc payload :: structure_mapper self rest
383-
| Pstr_extension (({txt = "local"}, _),_)
383+
| Pstr_extension (({txt = "private"}, _),_)
384384
->
385385
let rec aux acc (rest : Ast_structure.t) =
386386
match rest with
387-
| {pstr_desc = Pstr_extension (({txt = "local";loc}, payload), _) } :: next ->
387+
| {pstr_desc = Pstr_extension (({txt = "private";loc}, payload), _) } :: next ->
388388
begin match payload with
389389
| PStr work ->
390390
aux (Ext_list.rev_map_append work acc (fun x -> self.structure_item self x)) next
391391
| (PSig _ | PTyp _ | PPat _) ->
392-
Location.raise_errorf ~loc "local extension is not support"
392+
Location.raise_errorf ~loc "private extension is not support"
393393
end
394394
| _ -> expand_reverse acc (structure_mapper self rest)
395395
in aux [] stru

jscomp/test/internal_unused_test.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ open! P1
1414

1515
let f () = raise A
1616

17-
let%local b = 3
17+
let%private b = 3
1818

19-
let%local c = b + 2
19+
let%private c = b + 2
2020

21-
[%%local
21+
[%%private
2222
let d = c
2323
let f = d
2424
let h = fun[@bs] a b -> a + b
2525
]
2626

2727

28-
let%local h0 = 1
28+
let%private h0 = 1
2929

30-
let%local h1 = h0 + 1
30+
let%private h1 = h0 + 1
3131

32-
let%local h2 = h1 + 1
32+
let%private h2 = h1 + 1
3333

34-
[%%local
34+
[%%private
3535
let h3 = 1
3636
let h4 = h3 + 1
3737
let h5 = h4 + 1
3838
]
3939

4040
module N = struct
41-
let %local a = 3
41+
let %private a = 3
4242
let b = a + 2
4343
end
4444

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315565,16 +315565,16 @@ let rec
315565315565
| Pstr_extension ( ({txt = ("bs.raw"| "raw") ; loc}, payload), _attrs)
315566315566
->
315567315567
Ast_exp_handle_external.handle_raw_structure loc payload :: structure_mapper self rest
315568-
| Pstr_extension (({txt = "local"}, _),_)
315568+
| Pstr_extension (({txt = "private"}, _),_)
315569315569
->
315570315570
let rec aux acc (rest : Ast_structure.t) =
315571315571
match rest with
315572-
| {pstr_desc = Pstr_extension (({txt = "local";loc}, payload), _) } :: next ->
315572+
| {pstr_desc = Pstr_extension (({txt = "private";loc}, payload), _) } :: next ->
315573315573
begin match payload with
315574315574
| PStr work ->
315575315575
aux (Ext_list.rev_map_append work acc (fun x -> self.structure_item self x)) next
315576315576
| (PSig _ | PTyp _ | PPat _) ->
315577-
Location.raise_errorf ~loc "local extension is not support"
315577+
Location.raise_errorf ~loc "private extension is not support"
315578315578
end
315579315579
| _ -> expand_reverse acc (structure_mapper self rest)
315580315580
in aux [] stru

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315565,16 +315565,16 @@ let rec
315565315565
| Pstr_extension ( ({txt = ("bs.raw"| "raw") ; loc}, payload), _attrs)
315566315566
->
315567315567
Ast_exp_handle_external.handle_raw_structure loc payload :: structure_mapper self rest
315568-
| Pstr_extension (({txt = "local"}, _),_)
315568+
| Pstr_extension (({txt = "private"}, _),_)
315569315569
->
315570315570
let rec aux acc (rest : Ast_structure.t) =
315571315571
match rest with
315572-
| {pstr_desc = Pstr_extension (({txt = "local";loc}, payload), _) } :: next ->
315572+
| {pstr_desc = Pstr_extension (({txt = "private";loc}, payload), _) } :: next ->
315573315573
begin match payload with
315574315574
| PStr work ->
315575315575
aux (Ext_list.rev_map_append work acc (fun x -> self.structure_item self x)) next
315576315576
| (PSig _ | PTyp _ | PPat _) ->
315577-
Location.raise_errorf ~loc "local extension is not support"
315577+
Location.raise_errorf ~loc "private extension is not support"
315578315578
end
315579315579
| _ -> expand_reverse acc (structure_mapper self rest)
315580315580
in aux [] stru

lib/4.06.1/whole_compiler.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413268,16 +413268,16 @@ let rec
413268413268
| Pstr_extension ( ({txt = ("bs.raw"| "raw") ; loc}, payload), _attrs)
413269413269
->
413270413270
Ast_exp_handle_external.handle_raw_structure loc payload :: structure_mapper self rest
413271-
| Pstr_extension (({txt = "local"}, _),_)
413271+
| Pstr_extension (({txt = "private"}, _),_)
413272413272
->
413273413273
let rec aux acc (rest : Ast_structure.t) =
413274413274
match rest with
413275-
| {pstr_desc = Pstr_extension (({txt = "local";loc}, payload), _) } :: next ->
413275+
| {pstr_desc = Pstr_extension (({txt = "private";loc}, payload), _) } :: next ->
413276413276
begin match payload with
413277413277
| PStr work ->
413278413278
aux (Ext_list.rev_map_append work acc (fun x -> self.structure_item self x)) next
413279413279
| (PSig _ | PTyp _ | PPat _) ->
413280-
Location.raise_errorf ~loc "local extension is not support"
413280+
Location.raise_errorf ~loc "private extension is not support"
413281413281
end
413282413282
| _ -> expand_reverse acc (structure_mapper self rest)
413283413283
in aux [] stru

0 commit comments

Comments
 (0)