Skip to content

Commit 84a3aef

Browse files
committed
apply the formatter, looks really nice
1 parent f27377a commit 84a3aef

File tree

103 files changed

+1855
-1963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1855
-1963
lines changed

jscomp/common/bs_loc.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ let merge (l: t) (r : t) =
3535
if is_ghost l then r
3636
else if is_ghost r then l
3737
else match l,r with
38-
| {loc_start ; _}, {loc_end; _} (* TODO: improve*)
39-
->
40-
{loc_start ;loc_end; loc_ghost = false}
38+
| {loc_start ; _}, {loc_end; _} (* TODO: improve*)
39+
->
40+
{loc_start ;loc_end; loc_ghost = false}
4141

4242
(* let none = Location.none *)

jscomp/common/bs_version.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@
2424
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2525
let version = "9.1.0"
2626
let header =
27-
"// Generated by ReScript, PLEASE EDIT WITH CARE"
27+
"// Generated by ReScript, PLEASE EDIT WITH CARE"
2828
let package_name = ref "bs-platform"
29-

jscomp/common/bs_warnings.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ let warn_literal_overflow loc =
4343

4444
let error_unescaped_delimiter loc txt =
4545
Location.prerr_warning loc (Bs_uninterpreted_delimiters txt)
46-
4746

4847

49-
48+

jscomp/common/ext_log.mli

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030

3131

3232
(** A Poor man's logging utility
33-
33+
3434
Example:
3535
{[
36-
err __LOC__ "xx"
36+
err __LOC__ "xx"
3737
]}
38-
*)
38+
*)
3939

4040

4141

@@ -48,4 +48,4 @@ type 'a logging = ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a
4848
val dwarn :
4949
?__POS__:(string * int * int *int) ->
5050
'a logging
51-
51+

jscomp/common/js_config.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let cross_module_inline = ref false
3939

4040
let diagnose = ref false
4141
let get_diagnose () =
42-
!diagnose
42+
!diagnose
4343
#if undefined BS_RELEASE_BUILD then
4444
|| Sys.getenv_opt "RES_DEBUG_FILE" <> None
4545
#end

jscomp/common/js_config.mli

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ val no_version_header : bool ref
3939
*)
4040

4141
(* val get_current_package_name_and_path :
42-
Js_packages_info.module_system ->
43-
Js_packages_info.info_query *)
42+
Js_packages_info.module_system ->
43+
Js_packages_info.info_query *)
4444

4545

4646
(* val set_package_name : string -> unit
47-
val get_package_name : unit -> string option *)
47+
val get_package_name : unit -> string option *)
4848

4949
(** cross module inline option *)
5050
val cross_module_inline : bool ref
51-
51+
5252
(** diagnose option *)
5353
val diagnose : bool ref
5454
val get_diagnose : unit -> bool

jscomp/common/lam_methname.ml

+36-36
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,38 @@
2424

2525

2626
(**
27-
{[
28-
_open -> open
29-
_in -> in
30-
_MAX_LENGTH -> MAX_LENGTH
31-
_Capital -> Capital
32-
33-
_open__ -> _open
34-
open__ -> open
35-
36-
_'x -> 'x
27+
{[
28+
_open -> open
29+
_in -> in
30+
_MAX_LENGTH -> MAX_LENGTH
31+
_Capital -> Capital
3732
38-
_Capital__ -> _Capital
39-
_MAX__ -> _MAX
40-
__ -> __
41-
__x -> __x
42-
___ -> _
43-
____ -> __
44-
_ -> _ (* error *)
45-
33+
_open__ -> _open
34+
open__ -> open
35+
36+
_'x -> 'x
37+
38+
_Capital__ -> _Capital
39+
_MAX__ -> _MAX
40+
__ -> __
41+
__x -> __x
42+
___ -> _
43+
____ -> __
44+
_ -> _ (* error *)
4645
47-
]}
48-
First we scan '__' from end to start,
49-
If found, discard it.
50-
Otherwise, check if it is [_ + keyword] or followed by capital letter,
51-
If so, discard [_].
5246
53-
Limitations: user can not have [_Capital__, _Capital__other] to
54-
make it all compile to [Capital].
55-
Keyword is fine [open__, open__other].
56-
So we loose polymorphism over capital letter.
57-
It is okay, otherwise, if [_Captial__] is interpreted as [Capital], then
58-
there is no way to express [_Capital]
47+
]}
48+
First we scan '__' from end to start,
49+
If found, discard it.
50+
Otherwise, check if it is [_ + keyword] or followed by capital letter,
51+
If so, discard [_].
52+
53+
Limitations: user can not have [_Capital__, _Capital__other] to
54+
make it all compile to [Capital].
55+
Keyword is fine [open__, open__other].
56+
So we loose polymorphism over capital letter.
57+
It is okay, otherwise, if [_Captial__] is interpreted as [Capital], then
58+
there is no way to express [_Capital]
5959
*)
6060

6161
(* Copied from [ocaml/parsing/lexer.mll] *)
@@ -95,7 +95,7 @@ let key_words = Hash_set_string.of_array [|
9595
"of";
9696
"open";
9797
"or";
98-
(* "parser", PARSER; *)
98+
(* "parser", PARSER; *)
9999
"private";
100100
"rec";
101101
"sig";
@@ -118,14 +118,14 @@ let key_words = Hash_set_string.of_array [|
118118
"lsl";
119119
"lsr";
120120
"asr";
121-
|]
121+
|]
122122
let double_underscore = "__"
123123

124124
(*https://caml.inria.fr/pub/docs/manual-ocaml/lex.html
125-
{[
125+
{[
126126
127-
label-name ::= lowercase-ident
128-
]}
127+
label-name ::= lowercase-ident
128+
]}
129129
*)
130130
let valid_start_char x =
131131
match x with
@@ -139,8 +139,8 @@ let translate name =
139139
if name.[0] = '_' then begin
140140
let try_key_word = (String.sub name 1 (name_len - 1)) in
141141
if name_len > 1 &&
142-
(not (valid_start_char try_key_word.[0])
143-
|| Hash_set_string.mem key_words try_key_word) then
142+
(not (valid_start_char try_key_word.[0])
143+
|| Hash_set_string.mem key_words try_key_word) then
144144
try_key_word
145145
else
146146
name

jscomp/common/ml_binary.mli

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626

2727
(* This file was used to read reason ast
28-
and part of parsing binary ast
29-
*)
28+
and part of parsing binary ast
29+
*)
3030
type _ kind =
3131
| Ml : Parsetree.structure kind
3232
| Mli : Parsetree.signature kind
@@ -35,7 +35,7 @@ type _ kind =
3535
val read_ast : 'a kind -> in_channel -> 'a
3636

3737
val write_ast :
38-
'a kind -> string -> 'a -> out_channel -> unit
38+
'a kind -> string -> 'a -> out_channel -> unit
3939

4040
val magic_of_kind : 'a kind -> string
4141

jscomp/core/bs_conditional_initial.mli

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
(** This function set up built in compile time variables used in
2626
conditional compilation so that
2727
{[
28-
#if BS then
29-
#elif .. then
30-
#end
28+
#if BS then
29+
#elif .. then
30+
#end
3131
]}
3232
Is understood, also make sure the playground do the same initialization.
3333
*)

jscomp/depends/binary_ast.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ val magic_sep_char : char
5050
5151
Use case cat - | fan -printer -impl -
5252
redirect the standard input to fan
53-
*)
53+
*)
5454
val write_ast :
5555
sourcefile:string ->
5656
output:string ->

jscomp/depends/bspack_ast_extract.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ val build_queue :
7272
('b, 'c) t Map_string.t ->
7373
(Format.formatter -> string -> string -> 'b -> unit) ->
7474
(Format.formatter -> string -> string -> 'c -> unit) -> unit
75-
75+
7676
val handle_queue :
7777
string Queue.t ->
7878
('a, 'b) t Map_string.t ->

jscomp/main/bsb_helper_main.mli

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525

26-
(** Used to generate .d file, for example
27-
{[
28-
bsb_helper.exe -g 0 -MD src/hi/hello.ml
29-
]}
30-
It will read the cache file and generate the corresponding
31-
[.d] file. This [.d] file will be used as attribute [depfile]
32-
whether we use namespace or not, the filename of [.mlast], [.d]
33-
should be kept the same, we only need change the name of [.cm*]
34-
and the contents of filename in [.d]
35-
*)
26+
(** Used to generate .d file, for example
27+
{[
28+
bsb_helper.exe -g 0 -MD src/hi/hello.ml
29+
]}
30+
It will read the cache file and generate the corresponding
31+
[.d] file. This [.d] file will be used as attribute [depfile]
32+
whether we use namespace or not, the filename of [.mlast], [.d]
33+
should be kept the same, we only need change the name of [.cm*]
34+
and the contents of filename in [.d]
35+
*)

jscomp/main/bspack_main.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ val read_lines : string -> string -> string list
3434
Filename.concat "/bb/x/" "/bb/x/";;
3535
]}
3636
*)
37-
37+

0 commit comments

Comments
 (0)