Skip to content

Commit e36ef79

Browse files
committed
rename Buffer into Ext_buffer
1 parent f68e5ff commit e36ef79

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

jscomp/bsb/bsb_ninja_rule.ml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,55 +123,55 @@ let make_custom_rules
123123
builtin =
124124
(** FIXME: We don't need set [-o ${out}] when building ast
125125
since the default is already good -- it does not*)
126-
let buf = Buffer.create 100 in
126+
let buf = Ext_buffer.create 100 in
127127
let mk_ml_cmj_cmd
128128
~read_cmi
129129
~is_dev
130130
~postbuild : string =
131-
Buffer.clear buf;
132-
Buffer.add_string buf "$bsc $g_pkg_flg -color always";
131+
Ext_buffer.clear buf;
132+
Ext_buffer.add_string buf "$bsc $g_pkg_flg -color always";
133133
if bs_suffix then
134-
Buffer.add_string buf " -bs-suffix";
134+
Ext_buffer.add_string buf " -bs-suffix";
135135
if read_cmi then
136-
Buffer.add_string buf " -bs-read-cmi";
136+
Ext_buffer.add_string buf " -bs-read-cmi";
137137
if is_dev then
138-
Buffer.add_string buf " $g_dev_incls";
139-
Buffer.add_string buf " $g_lib_incls" ;
138+
Ext_buffer.add_string buf " $g_dev_incls";
139+
Ext_buffer.add_string buf " $g_lib_incls" ;
140140
if is_dev then
141-
Buffer.add_string buf " $g_dpkg_incls";
141+
Ext_buffer.add_string buf " $g_dpkg_incls";
142142
if not has_builtin then
143-
Buffer.add_string buf " -nostdlib";
144-
Buffer.add_string buf " $warnings $bsc_flags";
143+
Ext_buffer.add_string buf " -nostdlib";
144+
Ext_buffer.add_string buf " $warnings $bsc_flags";
145145
if has_gentype then
146-
Buffer.add_string buf " $gentypeconfig";
147-
Buffer.add_string buf " -o $out $in";
146+
Ext_buffer.add_string buf " $gentypeconfig";
147+
Ext_buffer.add_string buf " -o $out $in";
148148
if postbuild then
149-
Buffer.add_string buf " $postbuild";
150-
Buffer.contents buf
149+
Ext_buffer.add_string buf " $postbuild";
150+
Ext_buffer.contents buf
151151
in
152152
let mk_ast ~(has_pp : bool) ~has_ppx ~has_reason_react_jsx : string =
153-
Buffer.clear buf ;
154-
Buffer.add_string buf "$bsc $warnings -color always";
153+
Ext_buffer.clear buf ;
154+
Ext_buffer.add_string buf "$bsc $warnings -color always";
155155
(match refmt with
156156
| None -> ()
157157
| Some x ->
158-
Buffer.add_string buf " -bs-refmt ";
159-
Buffer.add_string buf (Ext_filename.maybe_quote x);
158+
Ext_buffer.add_string buf " -bs-refmt ";
159+
Ext_buffer.add_string buf (Ext_filename.maybe_quote x);
160160
);
161161
if has_pp then
162-
Buffer.add_string buf " $pp_flags";
162+
Ext_buffer.add_string buf " $pp_flags";
163163
(match has_reason_react_jsx, reason_react_jsx with
164164
| false, _
165165
| _, None -> ()
166166
| _, Some Jsx_v2
167-
-> Buffer.add_string buf " -bs-jsx 2"
167+
-> Ext_buffer.add_string buf " -bs-jsx 2"
168168
| _, Some Jsx_v3
169-
-> Buffer.add_string buf " -bs-jsx 3"
169+
-> Ext_buffer.add_string buf " -bs-jsx 3"
170170
);
171171
if has_ppx then
172-
Buffer.add_string buf " $ppx_flags";
173-
Buffer.add_string buf " $bsc_flags -o $out -bs-syntax-only -bs-binary-ast $in";
174-
Buffer.contents buf
172+
Ext_buffer.add_string buf " $ppx_flags";
173+
Ext_buffer.add_string buf " $bsc_flags -o $out -bs-syntax-only -bs-binary-ast $in";
174+
Ext_buffer.contents buf
175175
in
176176
let build_ast =
177177
define

jscomp/ext/ext_buffer.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let contents b = Bytes.sub_string b.buffer 0 b.position
4848

4949
let length b = b.position
5050
let is_empty b = b.position = 0
51-
(* let clear b = b.position <- 0 *)
51+
let clear b = b.position <- 0
5252

5353
(* let reset b =
5454
b.position <- 0; b.buffer <- b.initial_buffer;

jscomp/ext/ext_buffer.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ val length : t -> int
4747

4848
val is_empty : t -> bool
4949

50-
(* val clear : t -> unit *)
50+
val clear : t -> unit
5151
(** Empty the buffer. *)
5252

5353

0 commit comments

Comments
 (0)