File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,14 +173,21 @@ let add_mapping builder ~generated_line ~generated_column (loc : Location.t) =
173173 :: builder.mappings;
174174 builder.last_generated < - Some (generated_line, generated_column)
175175
176+ let take_marker_loc id =
177+ match Hashtbl. find_opt marker_locs id with
178+ | None -> None
179+ | Some loc ->
180+ Hashtbl. remove marker_locs id;
181+ Some loc
182+
176183let mark_comment fmt comment =
177184 if is_prefix ~prefix: marker_prefix comment then (
178185 let prefix_len = String. length marker_prefix in
179186 let id =
180187 int_of_string
181188 (String. sub comment prefix_len (String. length comment - prefix_len))
182189 in
183- (match (! current, Hashtbl. find_opt marker_locs id) with
190+ (match (! current, take_marker_loc id) with
184191 | Some builder , Some loc ->
185192 let generated_line, generated_column = Ext_pp. position fmt in
186193 add_mapping builder ~generated_line ~generated_column loc
You can’t perform that action at this time.
0 commit comments