Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Sep 4, 2024
1 parent 49ae88c commit 52e4ac1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions compiler/lib/source_map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ module Mappings = struct
0
edits
in
(* Remove trailing ';' *)
if Buffer.length buf > 0 then
Buffer.truncate buf (Buffer.length buf - 1);
Uninterpreted (Buffer.contents buf)

let num_gen_lines m =
Expand Down Expand Up @@ -411,6 +414,9 @@ module Mappings = struct
0
(List.init ~len:(num_gen_lines m2) ~f:(Fun.const Line_edits.Keep))
in
(* Remove trailing ';' *)
if Buffer.length buf > 0 then
Buffer.truncate buf (Buffer.length buf - 1);
Uninterpreted (Buffer.contents buf)

let encode mapping =
Expand Down
2 changes: 1 addition & 1 deletion compiler/tests-compiler/sourcemap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ let%expect_test _ =
print_mapping m;
[%expect
{|
CASU;;GCUU;;;;;;;;;;;;;;;;;;;;GCff;
CASU;;GCUU;;;;;;;;;;;;;;;;;;;;GCff
sa:10:10 -> 1:1
sb:20:20 -> 3:3
sa2:5:5 -> 23:3 |}]

0 comments on commit 52e4ac1

Please sign in to comment.