Skip to content

Commit e2de519

Browse files
authored
[interpreter] JS Conversion: add of_loc_unquoted and use it in comments (#1997)
Use the unquoted form in the comment, to match the previous output.
1 parent 4f4c67a commit e2de519

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

interpreter/script/js.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,11 @@ let of_bytes = of_string_with String.iter add_hex_char
672672
let of_string = of_string_with String.iter add_char
673673
let of_name = of_string_with List.iter add_unicode_char
674674

675+
let of_loc_unquoted at =
676+
Filename.basename at.left.file ^ ":" ^ string_of_int at.left.line
677+
675678
let of_loc at =
676-
of_string (Filename.basename at.left.file ^ ":" ^ string_of_int at.left.line)
679+
of_string(of_loc_unquoted at)
677680

678681
let of_float z =
679682
match string_of_float z with
@@ -812,8 +815,8 @@ let of_assertion env ass =
812815
of_assertion' env act loc "assert_exception" [] None
813816

814817
let of_command env cmd =
818+
"\n// " ^ of_loc_unquoted cmd.at ^ "\n" ^
815819
let loc = of_loc cmd.at in
816-
"\n// " ^ loc ^ "\n" ^
817820
match cmd.it with
818821
| Module (x_opt, def) ->
819822
let rec unquote def =

0 commit comments

Comments
 (0)