Skip to content

Commit 050751f

Browse files
committed
Add internal local support
1 parent a81c57a commit 050751f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

jscomp/core/bs_conditional_initial.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
(* Clflags.keep_locs := false; *)
2828
let setup_env () =
2929
Env.Persistent_signature.load := Bs_cmi_load.load_cmi;
30+
Typemod.should_hide := Typemod_hide.should_hide;
3031
Clflags.no_std_include := true;
3132
Warnings.parse_options false Bsc_warnings.defaults_w;
3233
Warnings.parse_options true Bsc_warnings.defaults_warn_error;

jscomp/core/typemod_hide.ml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(* Copyright (C) 2020 Authors of BuckleScript
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU Lesser General Public License as published by
5+
* the Free Software Foundation, either version 3 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* In addition to the permissions granted to you by the LGPL, you may combine
9+
* or link a "work that uses the Library" with a publicly distributed version
10+
* of this file to produce a combined library or application, then distribute
11+
* that combined work under the terms of your choosing, with no requirement
12+
* to comply with the obligations normally placed on you by section 4 of the
13+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
14+
* should you choose to use a later version).
15+
*
16+
* This program is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General Public License
22+
* along with this program; if not, write to the Free Software
23+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
24+
25+
26+
let should_hide ( x : Typedtree.module_binding) =
27+
match x.mb_attributes with
28+
| [] -> false
29+
| ({txt = "internal.local";_},_) :: rest -> true
30+
| _ :: rest ->
31+
Ext_list.exists rest (fun (x,_) -> x.txt = "internal.local")

0 commit comments

Comments
 (0)