File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ type annotations =
9
9
| LocalValue of Ident .t
10
10
| DefJmp of Shape.Uid .t
11
11
12
+ let counter =
13
+ let c = ref 0 in
14
+ fun () ->
15
+ incr c;
16
+ ! c
17
+
12
18
module Analysis = struct
13
19
open Typedtree
14
20
open Odoc_model.Paths
@@ -331,10 +337,10 @@ let postprocess_poses source_id poses uid_to_id uid_to_loc =
331
337
let local_def_anchors =
332
338
List. filter_map
333
339
(function
334
- | LocalDefinition id , ( start , _ ) ->
340
+ | LocalDefinition id , _ ->
335
341
let name =
336
342
Odoc_model.Names.LocalName. make_std
337
- (Printf. sprintf " local_%s_%d" (Ident. name id) start )
343
+ (Printf. sprintf " local_%s_%d" (Ident. name id) (counter () ) )
338
344
in
339
345
let identifier =
340
346
Odoc_model.Paths.Identifier.Mk. source_location_int
@@ -476,8 +482,7 @@ let of_cmt (source_id : Odoc_model.Paths.Identifier.SourcePage.t)
476
482
| Item _ ->
477
483
let name =
478
484
Odoc_model.Names.DefName. make_std
479
- (Printf. sprintf " def_%d_%d" loc.loc_start.pos_cnum
480
- loc.loc_end.pos_cnum)
485
+ (Printf. sprintf " def_%d" (counter () ))
481
486
in
482
487
Some name
483
488
| _ -> None )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ let segr = Yoyo.Aa
12
12
13
13
let x = 2
14
14
let y = x + 1
15
- let z a = if x = 1 || true then x + y else 0
15
+ let z a = if x = 1 || true then x + y else a
16
16
17
17
module A = struct end
18
18
module B = A
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Files containing some values:
15
15
16
16
let x = 2
17
17
let y = x + 1
18
- let z a = if x = 1 || true then x + y else 0
18
+ let z a = if x = 1 || true then x + y else a
19
19
20
20
module A = struct end
21
21
module B = A
@@ -273,7 +273,7 @@ Ids generated in the source code:
273
273
id= " val-{ x } 2"
274
274
id= " val-y"
275
275
id= " val-z"
276
- id= " local_a_148 "
276
+ id= " local_a_2 "
277
277
id= " module-A"
278
278
id= " module-B"
279
279
id= " module-type-T"
@@ -295,7 +295,7 @@ Ids generated in the source code:
295
295
id= " module-F.argument-1-M.module-A"
296
296
id= " module-F.module-B"
297
297
id= " module-FM"
298
- id= " def_591_612 "
298
+ id= " def_1 "
299
299
id= " module-FF"
300
300
id= " module-FF2"
301
301
id= " module-FF2.argument-1-A.module-E"
You can’t perform that action at this time.
0 commit comments