Skip to content

Commit dfc04db

Browse files
committedApr 19, 2021
Adapt playground to newest internal syntax apis
1 parent 5b6c35d commit dfc04db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎jscomp/refmt/jsoo_refmt_main.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ module ResDriver = struct
265265
let startPos = Res_diagnostics.getStartPos(d) in
266266
let endPos = Res_diagnostics.getEndPos(d) in
267267
let msg = Res_diagnostics.explain(d) in
268+
let loc = {loc_start = startPos; Location.loc_end=endPos; loc_ghost=false} in
269+
let err = { Location.loc; msg; sub=[]; if_highlight=""} in
268270
Res_diagnostics_printing_utils.Super_location.super_error_reporter
269271
Format.str_formatter
270-
~src
271-
~startPos
272-
~endPos
273-
~msg;
272+
src
273+
err;
274274
Format.flush_str_formatter ()
275275

276276
module ReasonBinary = struct
@@ -287,7 +287,7 @@ module ResDriver = struct
287287
let extractConcreteSyntax ~(filename:string) (src:string) =
288288
let commentData = ref [] in
289289
let stringData = ref [] in
290-
let scanner = Res_scanner.make (Bytes.of_string src) ~filename in
290+
let scanner = Res_scanner.make src ~filename in
291291

292292
let rec next prevEndPos scanner =
293293
let (startPos, endPos, token) = Res_scanner.scan scanner in
@@ -325,7 +325,7 @@ module ResDriver = struct
325325
| _ as diagnostics -> (true, diagnostics)
326326
in {
327327
filename = engine.scanner.filename;
328-
source = Bytes.to_string engine.scanner.src;
328+
source = engine.scanner.src;
329329
parsetree = structure;
330330
diagnostics;
331331
invalid;

0 commit comments

Comments
 (0)