From d8338794e880f0ad6922867724c141c6e52b3622 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Thu, 12 Dec 2019 16:39:38 +0100 Subject: [PATCH] Fix issue where getting the ident binding time only works for 4.08. (#363) * Fix issue where getting the ident binding time only works for 4.08. * Cosmetic: make the ident hack explicit so it's clear it only works for 408. --- core/Query.re | 6 +++--- ocaml_typing/current/Current.ml | 6 +++--- process_ocaml/402/ProcessCmt.re | 28 ++++++++++++++-------------- process_ocaml/402/ProcessExtra.re | 6 +++--- process_ocaml/406/ProcessCmt.re | 28 ++++++++++++++-------------- process_ocaml/406/ProcessExtra.re | 6 +++--- process_ocaml/407/ProcessCmt.re | 28 ++++++++++++++-------------- process_ocaml/407/ProcessExtra.re | 6 +++--- process_ocaml/408/ProcessCmt.re | 28 ++++++++++++++-------------- process_ocaml/408/ProcessExtra.re | 6 +++--- process_ocaml/base/ProcessCmt.re | 28 ++++++++++++++-------------- process_ocaml/base/ProcessExtra.re | 6 +++--- 12 files changed, 91 insertions(+), 91 deletions(-) diff --git a/core/Query.re b/core/Query.re index b40caf75..057a4857 100644 --- a/core/Query.re +++ b/core/Query.re @@ -46,7 +46,7 @@ let findInScope = (pos, name, stamps) => { let rec joinPaths = (modulePath, path) => { switch modulePath { - | Path.Pident(ident) => (Current.ident_binding_time(ident), Ident.name(ident), path) + | Path.Pident(ident) => (Current.ident_binding_time_408(ident), Ident.name(ident), path) | Path.Papply(fnPath, _argPath) => joinPaths(fnPath, path) | Path.Pdot(inner, name) => joinPaths(inner, Nested(name, path)) } @@ -54,9 +54,9 @@ let rec joinPaths = (modulePath, path) => { let rec makePath = (modulePath) => { switch modulePath { - | Path.Pident(ident) when Current.ident_binding_time(ident) === 0 => + | Path.Pident(ident) when Current.ident_binding_time_408(ident) === 0 => `GlobalMod(Ident.name(ident)) - | Path.Pident(ident) => `Stamp(Current.ident_binding_time(ident)) + | Path.Pident(ident) => `Stamp(Current.ident_binding_time_408(ident)) | Path.Papply(fnPath, _argPath) => makePath(fnPath) | Path.Pdot(inner, name) => `Path(joinPaths(inner, Tip(name))) } diff --git a/ocaml_typing/current/Current.ml b/ocaml_typing/current/Current.ml index 1e332bd4..ff8681f9 100644 --- a/ocaml_typing/current/Current.ml +++ b/ocaml_typing/current/Current.ml @@ -14,14 +14,14 @@ type longident = Longident.t = type abstract_ident = Ident.t -type ident = +type ident_408 = | Local of { name: string; stamp: int } | Scoped of { name: string; stamp: int; scope: int } | Global of string | Predef of { name: string; stamp: int } -let ident_binding_time ident = - let current_ident = (Obj.magic ident : ident) in +let ident_binding_time_408 (ident: Ident.t) = + let current_ident = (Obj.magic ident : ident_408) in match current_ident with | Predef { stamp } | Scoped { stamp } diff --git a/process_ocaml/402/ProcessCmt.re b/process_ocaml/402/ProcessCmt.re index 49b89c91..4cacf9ea 100644 --- a/process_ocaml/402/ProcessCmt.re +++ b/process_ocaml/402/ProcessCmt.re @@ -107,7 +107,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item let declared = addItem( ~name=Location.mknoloc(Ident.name(ident)), ~extent=loc, - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, ~contents, val_attributes, @@ -139,7 +139,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item | Type_variant(constructors) => { Variant(constructors |. Belt.List.map(({cd_loc, cd_id, cd_args, cd_res, cd_attributes}) => { let name = Ident.name(cd_id); - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); let contents = { Type.Constructor.stamp, name: Location.mknoloc(name), @@ -169,13 +169,13 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item } | Type_record(labels, _) => Record(labels |> List.map( ({ld_id, ld_type}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); let name = Ident.name(ld_id); {Type.Attribute.stamp: astamp, name: Location.mknoloc(name), typ: Shared.makeFlexible(ld_type), typLoc: Location.none} } )) } - }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); + }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Ident.binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); [{...declared, contents: Module.Type(declared.contents)}] } /* | Sig_module({stamp, name}, {md_type: Mty_ident(path) | Mty_alias(path), md_attributes, md_loc}, _) => @@ -190,7 +190,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item ~extent=md_loc, ~contents=forModuleType(env, md_type), ~name=Location.mknoloc(Ident.name(ident)), - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, md_attributes, exported.modules, @@ -227,7 +227,7 @@ let getModuleTypePath = (mod_desc) => switch mod_desc { }; let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, typ_params, typ_name: name, typ_attributes, typ_type, typ_kind, typ_manifest}) => { - let stamp = Current.ident_binding_time(typ_id); + let stamp = Ident.binding_time(typ_id); let declared = addItem(~extent=typ_loc, ~contents={ Type.params: typ_params |> List.map(((t, _)) => (Shared.makeFlexible(t.ctyp_type), t.ctyp_loc)), typ: Shared.makeDeclaration(typ_type), @@ -244,7 +244,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty } | Ttype_open => Open | Ttype_variant(constructors) => Variant(constructors |> List.map(({cd_id, cd_name: name, cd_args, cd_res}) => { - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); { Type.Constructor.stamp, name, @@ -254,7 +254,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty }})) | Ttype_record(labels) => Record(labels |> List.map( ({ld_id, ld_name: name, ld_type: {ctyp_type, ctyp_loc}}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); {Type.Attribute.stamp: astamp, name, typ: Shared.makeFlexible(ctyp_type), typLoc: ctyp_loc} })) } @@ -267,7 +267,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { let declared = addItem( ~name, - ~stamp=Current.ident_binding_time(val_id), + ~stamp=Ident.binding_time(val_id), ~extent=val_loc, ~contents={Value.typ: Shared.makeFlexible(val_desc.ctyp_type), recursive: false}, ~env, @@ -282,7 +282,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { } | Tsig_module({md_id, md_attributes, md_loc, md_name: name, md_type: {mty_type}}) => { let contents = forModuleType(env, mty_type); - let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Ident.binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tsig_include({incl_mod, incl_type}) => @@ -342,14 +342,14 @@ let rec forItem = ( Value.recursive: false, typ: Shared.makeFlexible(pat_type), }; - let declared = addItem(~name, ~stamp=Current.ident_binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); + let declared = addItem(~name, ~stamp=Ident.binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); Some({...declared, contents: Module.Value(declared.contents)}) | _ => None }, bindings) | Tstr_module({mb_id, mb_attributes, mb_loc, mb_name: name, mb_expr: {mod_desc}}) => { let contents = forModule(env, mod_desc, name.txt); - let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Ident.binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tstr_include({incl_mod, incl_type}) => @@ -367,7 +367,7 @@ let rec forItem = ( topLevel | Tstr_primitive({val_id, val_name: name, val_loc, val_attributes, val_val: {val_type}}) => { - let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); + let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Ident.binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); [{...declared, contents: Module.Value(declared.contents)}] } | Tstr_type(decls) => @@ -384,7 +384,7 @@ and forModule = (env, mod_desc, moduleName) => switch mod_desc { } | Tmod_functor(ident, argName, maybeType, resultExpr) => { maybeType |?< t => forTreeModuleType(~env, t) |?< kind => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); let declared = newDeclared( ~contents=kind, ~name=argName, diff --git a/process_ocaml/402/ProcessExtra.re b/process_ocaml/402/ProcessExtra.re index 98f9efb8..49fd5568 100644 --- a/process_ocaml/402/ProcessExtra.re +++ b/process_ocaml/402/ProcessExtra.re @@ -358,7 +358,7 @@ module F = (Collector: { let enter_signature_item = item => switch (item.sig_desc) { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { - let stamp = Current.ident_binding_time(val_id); + let stamp = Ident.binding_time(val_id); if (!Hashtbl.mem(Collector.file.stamps.values, stamp)) { let declared = ProcessAttributes.newDeclared( ~name, @@ -429,12 +429,12 @@ module F = (Collector: { addForConstructor(pat_type, lident, constructor) } | Tpat_alias(_inner, ident, name) => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | Tpat_var(ident, name) => { /* Log.log("Pattern " ++ name.txt); */ - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | _ => () diff --git a/process_ocaml/406/ProcessCmt.re b/process_ocaml/406/ProcessCmt.re index 22fab1e5..7feab540 100644 --- a/process_ocaml/406/ProcessCmt.re +++ b/process_ocaml/406/ProcessCmt.re @@ -107,7 +107,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item let declared = addItem( ~name=Location.mknoloc(Ident.name(ident)), ~extent=loc, - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, ~contents, val_attributes, @@ -139,7 +139,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item | Type_variant(constructors) => { Variant(constructors |. Belt.List.map(({cd_loc, cd_id, cd_args, cd_res, cd_attributes}) => { let name = Ident.name(cd_id); - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); let contents = { Type.Constructor.stamp, name: Location.mknoloc(name), @@ -173,13 +173,13 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item } | Type_record(labels, _) => Record(labels |> List.map( ({ld_id, ld_type}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); let name = Ident.name(ld_id); {Type.Attribute.stamp: astamp, name: Location.mknoloc(name), typ: Shared.makeFlexible(ld_type), typLoc: Location.none} } )) } - }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); + }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Ident.binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); [{...declared, contents: Module.Type(declared.contents)}] } /* | Sig_module({stamp, name}, {md_type: Mty_ident(path) | Mty_alias(path), md_attributes, md_loc}, _) => @@ -194,7 +194,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item ~extent=md_loc, ~contents=forModuleType(env, md_type), ~name=Location.mknoloc(Ident.name(ident)), - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, md_attributes, exported.modules, @@ -231,7 +231,7 @@ let getModuleTypePath = (mod_desc) => switch mod_desc { }; let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, typ_params, typ_name: name, typ_attributes, typ_type, typ_kind, typ_manifest}) => { - let stamp = Current.ident_binding_time(typ_id); + let stamp = Ident.binding_time(typ_id); let declared = addItem(~extent=typ_loc, ~contents={ Type.params: typ_params |> List.map(((t, _)) => (Shared.makeFlexible(t.ctyp_type), t.ctyp_loc)), typ: Shared.makeDeclaration(typ_type), @@ -248,7 +248,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty } | Ttype_open => Open | Ttype_variant(constructors) => Variant(constructors |> List.map(({cd_id, cd_name: name, cd_args, cd_res}) => { - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); { Type.Constructor.stamp, name, @@ -262,7 +262,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty }})) | Ttype_record(labels) => Record(labels |> List.map( ({ld_id, ld_name: name, ld_type: {ctyp_type, ctyp_loc}}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); {Type.Attribute.stamp: astamp, name, typ: Shared.makeFlexible(ctyp_type), typLoc: ctyp_loc} })) } @@ -275,7 +275,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { let declared = addItem( ~name, - ~stamp=Current.ident_binding_time(val_id), + ~stamp=Ident.binding_time(val_id), ~extent=val_loc, ~contents={Value.typ: Shared.makeFlexible(val_desc.ctyp_type), recursive: false}, ~env, @@ -290,7 +290,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { } | Tsig_module({md_id, md_attributes, md_loc, md_name: name, md_type: {mty_type}}) => { let contents = forModuleType(env, mty_type); - let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Ident.binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tsig_include({incl_mod, incl_type}) => @@ -350,14 +350,14 @@ let rec forItem = ( Value.recursive: false, typ: Shared.makeFlexible(pat_type), }; - let declared = addItem(~name, ~stamp=Current.ident_binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); + let declared = addItem(~name, ~stamp=Ident.binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); Some({...declared, contents: Module.Value(declared.contents)}) | _ => None }, bindings) | Tstr_module({mb_id, mb_attributes, mb_loc, mb_name: name, mb_expr: {mod_desc}}) => { let contents = forModule(env, mod_desc, name.txt); - let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Ident.binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tstr_include({incl_mod, incl_type}) => @@ -375,7 +375,7 @@ let rec forItem = ( topLevel | Tstr_primitive({val_id, val_name: name, val_loc, val_attributes, val_val: {val_type}}) => { - let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); + let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Ident.binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); [{...declared, contents: Module.Value(declared.contents)}] } | Tstr_type(_, decls) => @@ -392,7 +392,7 @@ and forModule = (env, mod_desc, moduleName) => switch mod_desc { } | Tmod_functor(ident, argName, maybeType, resultExpr) => { maybeType |?< t => forTreeModuleType(~env, t) |?< kind => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); let declared = newDeclared( ~contents=kind, ~name=argName, diff --git a/process_ocaml/406/ProcessExtra.re b/process_ocaml/406/ProcessExtra.re index fb40e3be..f17a67d6 100644 --- a/process_ocaml/406/ProcessExtra.re +++ b/process_ocaml/406/ProcessExtra.re @@ -358,7 +358,7 @@ module F = (Collector: { let enter_signature_item = item => switch (item.sig_desc) { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { - let stamp = Current.ident_binding_time(val_id); + let stamp = Ident.binding_time(val_id); if (!Hashtbl.mem(Collector.file.stamps.values, stamp)) { let declared = ProcessAttributes.newDeclared( ~name, @@ -429,12 +429,12 @@ module F = (Collector: { addForConstructor(pat_type, lident, constructor) } | Tpat_alias(_inner, ident, name) => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | Tpat_var(ident, name) => { /* Log.log("Pattern " ++ name.txt); */ - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | _ => () diff --git a/process_ocaml/407/ProcessCmt.re b/process_ocaml/407/ProcessCmt.re index 44f6c565..715689fd 100644 --- a/process_ocaml/407/ProcessCmt.re +++ b/process_ocaml/407/ProcessCmt.re @@ -107,7 +107,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item let declared = addItem( ~name=Location.mknoloc(Ident.name(ident)), ~extent=loc, - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, ~contents, val_attributes, @@ -139,7 +139,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item | Type_variant(constructors) => { Variant(constructors |. Belt.List.map(({cd_loc, cd_id, cd_args, cd_res, cd_attributes}) => { let name = Ident.name(cd_id); - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); let contents = { Type.Constructor.stamp, name: Location.mknoloc(name), @@ -173,13 +173,13 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item } | Type_record(labels, _) => Record(labels |> List.map( ({ld_id, ld_type}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); let name = Ident.name(ld_id); {Type.Attribute.stamp: astamp, name: Location.mknoloc(name), typ: Shared.makeFlexible(ld_type), typLoc: Location.none} } )) } - }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); + }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Ident.binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); [{...declared, contents: Module.Type(declared.contents)}] } /* | Sig_module({stamp, name}, {md_type: Mty_ident(path) | Mty_alias(path), md_attributes, md_loc}, _) => @@ -194,7 +194,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item ~extent=md_loc, ~contents=forModuleType(env, md_type), ~name=Location.mknoloc(Ident.name(ident)), - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, md_attributes, exported.modules, @@ -231,7 +231,7 @@ let getModuleTypePath = (mod_desc) => switch mod_desc { }; let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, typ_params, typ_name: name, typ_attributes, typ_type, typ_kind, typ_manifest}) => { - let stamp = Current.ident_binding_time(typ_id); + let stamp = Ident.binding_time(typ_id); let declared = addItem(~extent=typ_loc, ~contents={ Type.params: typ_params |> List.map(((t, _)) => (Shared.makeFlexible(t.ctyp_type), t.ctyp_loc)), typ: Shared.makeDeclaration(typ_type), @@ -248,7 +248,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty } | Ttype_open => Open | Ttype_variant(constructors) => Variant(constructors |> List.map(({cd_id, cd_name: name, cd_args, cd_res}) => { - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); { Type.Constructor.stamp, name, @@ -262,7 +262,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty }})) | Ttype_record(labels) => Record(labels |> List.map( ({ld_id, ld_name: name, ld_type: {ctyp_type, ctyp_loc}}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); {Type.Attribute.stamp: astamp, name, typ: Shared.makeFlexible(ctyp_type), typLoc: ctyp_loc} })) } @@ -275,7 +275,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { let declared = addItem( ~name, - ~stamp=Current.ident_binding_time(val_id), + ~stamp=Ident.binding_time(val_id), ~extent=val_loc, ~contents={Value.typ: Shared.makeFlexible(val_desc.ctyp_type), recursive: false}, ~env, @@ -290,7 +290,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { } | Tsig_module({md_id, md_attributes, md_loc, md_name: name, md_type: {mty_type}}) => { let contents = forModuleType(env, mty_type); - let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Ident.binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tsig_include({incl_mod, incl_type}) => @@ -350,14 +350,14 @@ let rec forItem = ( Value.recursive: false, typ: Shared.makeFlexible(pat_type), }; - let declared = addItem(~name, ~stamp=Current.ident_binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); + let declared = addItem(~name, ~stamp=Ident.binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); Some({...declared, contents: Module.Value(declared.contents)}) | _ => None }, bindings) | Tstr_module({mb_id, mb_attributes, mb_loc, mb_name: name, mb_expr: {mod_desc}}) => { let contents = forModule(env, mod_desc, name.txt); - let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Ident.binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tstr_include({incl_mod, incl_type}) => @@ -375,7 +375,7 @@ let rec forItem = ( topLevel | Tstr_primitive({val_id, val_name: name, val_loc, val_attributes, val_val: {val_type}}) => { - let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); + let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Ident.binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); [{...declared, contents: Module.Value(declared.contents)}] } | Tstr_type(_, decls) => @@ -392,7 +392,7 @@ and forModule = (env, mod_desc, moduleName) => switch mod_desc { } | Tmod_functor(ident, argName, maybeType, resultExpr) => { maybeType |?< t => forTreeModuleType(~env, t) |?< kind => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); let declared = newDeclared( ~contents=kind, ~name=argName, diff --git a/process_ocaml/407/ProcessExtra.re b/process_ocaml/407/ProcessExtra.re index ec04aa45..0f1004f5 100644 --- a/process_ocaml/407/ProcessExtra.re +++ b/process_ocaml/407/ProcessExtra.re @@ -358,7 +358,7 @@ module F = (Collector: { let enter_signature_item = item => switch (item.sig_desc) { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { - let stamp = Current.ident_binding_time(val_id); + let stamp = Ident.binding_time(val_id); if (!Hashtbl.mem(Collector.file.stamps.values, stamp)) { let declared = ProcessAttributes.newDeclared( ~name, @@ -429,12 +429,12 @@ module F = (Collector: { addForConstructor(pat_type, lident, constructor) } | Tpat_alias(_inner, ident, name) => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | Tpat_var(ident, name) => { /* Log.log("Pattern " ++ name.txt); */ - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | _ => () diff --git a/process_ocaml/408/ProcessCmt.re b/process_ocaml/408/ProcessCmt.re index b68df198..55b58d81 100644 --- a/process_ocaml/408/ProcessCmt.re +++ b/process_ocaml/408/ProcessCmt.re @@ -108,7 +108,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item let declared = addItem( ~name=Location.mknoloc(Ident.name(ident)), ~extent=loc, - ~stamp=Current.ident_binding_time(ident), + ~stamp=Current.ident_binding_time_408(ident), ~env, ~contents, val_attributes, @@ -141,7 +141,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item | Type_variant(constructors) => { Variant(constructors |. Belt.List.map(({cd_loc, cd_id, cd_args, cd_res, cd_attributes}) => { let name = Ident.name(cd_id); - let stamp = Current.ident_binding_time(cd_id); + let stamp = Current.ident_binding_time_408(cd_id); let contents = { Type.Constructor.stamp, name: Location.mknoloc(name), @@ -175,13 +175,13 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item } | Type_record(labels, _) => Record(labels |> List.map( ({ld_id, ld_type}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Current.ident_binding_time_408(ld_id); let name = Ident.name(ld_id); {Type.Attribute.stamp: astamp, name: Location.mknoloc(name), typ: Shared.makeFlexible(ld_type), typLoc: Location.none} } )) } - }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); + }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time_408(ident), ~env, type_attributes, exported.types, env.stamps.types); [{...declared, contents: Module.Type(declared.contents)}] } /* | Sig_module({stamp, name}, {md_type: Mty_ident(path) | Mty_alias(path), md_attributes, md_loc}, _) => @@ -198,7 +198,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item ~extent=md_loc, ~contents=forModuleType(env, md_type), ~name=Location.mknoloc(Ident.name(ident)), - ~stamp=Current.ident_binding_time(ident), + ~stamp=Current.ident_binding_time_408(ident), ~env, md_attributes, exported.modules, @@ -235,7 +235,7 @@ let getModuleTypePath = (mod_desc) => switch mod_desc { }; let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, typ_params, typ_name: name, typ_attributes, typ_type, typ_kind, typ_manifest}) => { - let stamp = Current.ident_binding_time(typ_id); + let stamp = Current.ident_binding_time_408(typ_id); let declared = addItem(~extent=typ_loc, ~contents={ Type.params: typ_params |> List.map(((t, _)) => (Shared.makeFlexible(t.ctyp_type), t.ctyp_loc)), typ: Shared.makeDeclaration(typ_type), @@ -252,7 +252,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty } | Ttype_open => Open | Ttype_variant(constructors) => Variant(constructors |> List.map(({cd_id, cd_name: name, cd_args, cd_res}) => { - let stamp = Current.ident_binding_time(cd_id); + let stamp = Current.ident_binding_time_408(cd_id); { Type.Constructor.stamp, name, @@ -266,7 +266,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty }})) | Ttype_record(labels) => Record(labels |> List.map( ({ld_id, ld_name: name, ld_type: {ctyp_type, ctyp_loc}}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Current.ident_binding_time_408(ld_id); {Type.Attribute.stamp: astamp, name, typ: Shared.makeFlexible(ctyp_type), typLoc: ctyp_loc} })) } @@ -279,7 +279,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { let declared = addItem( ~name, - ~stamp=Current.ident_binding_time(val_id), + ~stamp=Current.ident_binding_time_408(val_id), ~extent=val_loc, ~contents={Value.typ: Shared.makeFlexible(val_desc.ctyp_type), recursive: false}, ~env, @@ -294,7 +294,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { } | Tsig_module({md_id, md_attributes, md_loc, md_name: name, md_type: {mty_type}}) => { let contents = forModuleType(env, mty_type); - let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time_408(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tsig_include({incl_mod, incl_type}) => @@ -354,14 +354,14 @@ let rec forItem = ( Value.recursive: false, typ: Shared.makeFlexible(pat_type), }; - let declared = addItem(~name, ~stamp=Current.ident_binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); + let declared = addItem(~name, ~stamp=Current.ident_binding_time_408(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); Some({...declared, contents: Module.Value(declared.contents)}) | _ => None }, bindings) | Tstr_module({mb_id, mb_attributes, mb_loc, mb_name: name, mb_expr: {mod_desc}}) => { let contents = forModule(env, mod_desc, name.txt); - let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time_408(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tstr_include({incl_mod, incl_type}) => @@ -379,7 +379,7 @@ let rec forItem = ( topLevel | Tstr_primitive({val_id, val_name: name, val_loc, val_attributes, val_val: {val_type}}) => { - let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); + let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time_408(val_id), ~env, val_attributes, exported.values, env.stamps.values); [{...declared, contents: Module.Value(declared.contents)}] } | Tstr_type(_, decls) => @@ -396,7 +396,7 @@ and forModule = (env, mod_desc, moduleName) => switch mod_desc { } | Tmod_functor(ident, argName, maybeType, resultExpr) => { maybeType |?< t => forTreeModuleType(~env, t) |?< kind => { - let stamp = Current.ident_binding_time(ident); + let stamp = Current.ident_binding_time_408(ident); let declared = newDeclared( ~contents=kind, ~name=argName, diff --git a/process_ocaml/408/ProcessExtra.re b/process_ocaml/408/ProcessExtra.re index 0ca1e236..4c552ac7 100644 --- a/process_ocaml/408/ProcessExtra.re +++ b/process_ocaml/408/ProcessExtra.re @@ -361,7 +361,7 @@ module F = (Collector: { let enter_signature_item = item => switch (item.sig_desc) { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { - let stamp = Current.ident_binding_time(val_id); + let stamp = Current.ident_binding_time_408(val_id); if (!Hashtbl.mem(Collector.file.stamps.values, stamp)) { let declared = ProcessAttributes.newDeclared( ~name, @@ -432,12 +432,12 @@ module F = (Collector: { addForConstructor(pat_type, lident, constructor) } | Tpat_alias(_inner, ident, name) => { - let stamp = Current.ident_binding_time(ident); + let stamp = Current.ident_binding_time_408(ident); addForPattern(stamp, name); } | Tpat_var(ident, name) => { /* Log.log("Pattern " ++ name.txt); */ - let stamp = Current.ident_binding_time(ident); + let stamp = Current.ident_binding_time_408(ident); addForPattern(stamp, name); } | _ => () diff --git a/process_ocaml/base/ProcessCmt.re b/process_ocaml/base/ProcessCmt.re index 4ee6c458..438df182 100644 --- a/process_ocaml/base/ProcessCmt.re +++ b/process_ocaml/base/ProcessCmt.re @@ -139,7 +139,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item let declared = addItem( ~name=Location.mknoloc(Ident.name(ident)), ~extent=loc, - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, ~contents, val_attributes, @@ -175,7 +175,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item | Type_variant(constructors) => { Variant(constructors |. Belt.List.map(({cd_loc, cd_id, cd_args, cd_res, cd_attributes}) => { let name = Ident.name(cd_id); - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); let contents = { Type.Constructor.stamp, name: Location.mknoloc(name), @@ -213,13 +213,13 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item } | Type_record(labels, _) => Record(labels |> List.map( ({ld_id, ld_type}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); let name = Ident.name(ld_id); {Type.Attribute.stamp: astamp, name: Location.mknoloc(name), typ: Shared.makeFlexible(ld_type), typLoc: Location.none} } )) } - }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Current.ident_binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); + }, ~name=Location.mknoloc(Ident.name(ident)), ~stamp=Ident.binding_time(ident), ~env, type_attributes, exported.types, env.stamps.types); [{...declared, contents: Module.Type(declared.contents)}] } /* | Sig_module({stamp, name}, {md_type: Mty_ident(path) | Mty_alias(path), md_attributes, md_loc}, _) => @@ -242,7 +242,7 @@ let rec forSignatureTypeItem = (env, exported: SharedTypes.Module.exported, item ~extent=md_loc, ~contents=forModuleType(env, md_type), ~name=Location.mknoloc(Ident.name(ident)), - ~stamp=Current.ident_binding_time(ident), + ~stamp=Ident.binding_time(ident), ~env, md_attributes, exported.modules, @@ -285,7 +285,7 @@ let getModuleTypePath = (mod_desc) => switch mod_desc { }; let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, typ_params, typ_name: name, typ_attributes, typ_type, typ_kind, typ_manifest}) => { - let stamp = Current.ident_binding_time(typ_id); + let stamp = Ident.binding_time(typ_id); let declared = addItem(~extent=typ_loc, ~contents={ Type.params: typ_params |> List.map(((t, _)) => (Shared.makeFlexible(t.ctyp_type), t.ctyp_loc)), typ: Shared.makeDeclaration(typ_type), @@ -302,7 +302,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty } | Ttype_open => Open | Ttype_variant(constructors) => Variant(constructors |> List.map(({cd_id, cd_name: name, cd_args, cd_res}) => { - let stamp = Current.ident_binding_time(cd_id); + let stamp = Ident.binding_time(cd_id); { Type.Constructor.stamp, name, @@ -320,7 +320,7 @@ let forTypeDeclaration = (~env, ~exported: Module.exported, {typ_id, typ_loc, ty }})) | Ttype_record(labels) => Record(labels |> List.map( ({ld_id, ld_name: name, ld_type: {ctyp_type, ctyp_loc}}) => { - let astamp = Current.ident_binding_time(ld_id); + let astamp = Ident.binding_time(ld_id); {Type.Attribute.stamp: astamp, name, typ: Shared.makeFlexible(ctyp_type), typLoc: ctyp_loc} })) } @@ -333,7 +333,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { let declared = addItem( ~name, - ~stamp=Current.ident_binding_time(val_id), + ~stamp=Ident.binding_time(val_id), ~extent=val_loc, ~contents={Value.typ: Shared.makeFlexible(val_desc.ctyp_type), recursive: false}, ~env, @@ -352,7 +352,7 @@ let forSignatureItem = (~env, ~exported: Module.exported, item) => { } | Tsig_module({md_id, md_attributes, md_loc, md_name: name, md_type: {mty_type}}) => { let contents = forModuleType(env, mty_type); - let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Current.ident_binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=md_loc, ~stamp=Ident.binding_time(md_id), ~env, md_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tsig_include({incl_mod, incl_type}) => @@ -412,14 +412,14 @@ let rec forItem = ( Value.recursive: false, typ: Shared.makeFlexible(pat_type), }; - let declared = addItem(~name, ~stamp=Current.ident_binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); + let declared = addItem(~name, ~stamp=Ident.binding_time(ident), ~env, ~extent=vb_loc, ~contents, vb_attributes, exported.values, env.stamps.values); Some({...declared, contents: Module.Value(declared.contents)}) | _ => None }, bindings) | Tstr_module({mb_id, mb_attributes, mb_loc, mb_name: name, mb_expr: {mod_desc}}) => { let contents = forModule(env, mod_desc, name.txt); - let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Current.ident_binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); + let declared = addItem(~contents, ~name, ~extent=mb_loc, ~stamp=Ident.binding_time(mb_id), ~env, mb_attributes, exported.modules, env.stamps.modules); [{...declared, contents: Module.Module(declared.contents)}] } | Tstr_include({incl_mod, incl_type}) => @@ -437,7 +437,7 @@ let rec forItem = ( topLevel | Tstr_primitive({val_id, val_name: name, val_loc, val_attributes, val_val: {val_type}}) => { - let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Current.ident_binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); + let declared = addItem(~extent=val_loc, ~contents={Value.recursive: false, typ: Shared.makeFlexible(val_type)}, ~name, ~stamp=Ident.binding_time(val_id), ~env, val_attributes, exported.values, env.stamps.values); [{...declared, contents: Module.Value(declared.contents)}] } #if 402 @@ -458,7 +458,7 @@ and forModule = (env, mod_desc, moduleName) => switch mod_desc { } | Tmod_functor(ident, argName, maybeType, resultExpr) => { maybeType |?< t => forTreeModuleType(~env, t) |?< kind => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); let declared = newDeclared( ~contents=kind, ~name=argName, diff --git a/process_ocaml/base/ProcessExtra.re b/process_ocaml/base/ProcessExtra.re index e0d68aca..df41d767 100644 --- a/process_ocaml/base/ProcessExtra.re +++ b/process_ocaml/base/ProcessExtra.re @@ -399,7 +399,7 @@ module F = (Collector: { let enter_signature_item = item => switch (item.sig_desc) { | Tsig_value({val_id, val_loc, val_name: name, val_desc, val_attributes}) => { - let stamp = Current.ident_binding_time(val_id); + let stamp = Ident.binding_time(val_id); if (!Hashtbl.mem(Collector.file.stamps.values, stamp)) { let declared = ProcessAttributes.newDeclared( ~name, @@ -470,12 +470,12 @@ module F = (Collector: { addForConstructor(pat_type, lident, constructor) } | Tpat_alias(_inner, ident, name) => { - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | Tpat_var(ident, name) => { /* Log.log("Pattern " ++ name.txt); */ - let stamp = Current.ident_binding_time(ident); + let stamp = Ident.binding_time(ident); addForPattern(stamp, name); } | _ => ()