From d40779f2e4ed04ac4f4a800cddec6ff384984677 Mon Sep 17 00:00:00 2001 From: lubegasimon Date: Sun, 21 Feb 2021 13:41:04 +0300 Subject: [PATCH] a few modifications Signed-off-by: lubegasimon --- src/model/ident_env.cppo.ml | 2 +- src/model/names.ml | 3 +-- src/xref2/test.md | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/model/ident_env.cppo.ml b/src/model/ident_env.cppo.ml index ce415b8f96..56a45f6b3e 100644 --- a/src/model/ident_env.cppo.ml +++ b/src/model/ident_env.cppo.ml @@ -19,7 +19,6 @@ open Names module Id = Paths.Identifier module P = Paths.Path -open Typedtree type type_ident = Paths.Identifier.Path.Type.t @@ -226,6 +225,7 @@ let extract_signature_tree_items sg = List.map extract_signature_tree_item sg.sig_items |> List.flatten let rec read_pattern pat = + let open Typedtree in match pat.pat_desc with | Tpat_var(id, _) -> [`Value(id, false)] | Tpat_alias(pat, id, _) -> `Value(id, false) :: read_pattern pat diff --git a/src/model/names.ml b/src/model/names.ml index 99663ac8ad..02adaabcd8 100644 --- a/src/model/names.ml +++ b/src/model/names.ml @@ -54,8 +54,7 @@ module Name : Name = struct let make_std s = let s = parenthesise s in - if String.length s > 0 && s.[0] = '{' then raise (Invalid_argument s) - else Std s + Std s let of_ident id = make_std (Ident.name id) diff --git a/src/xref2/test.md b/src/xref2/test.md index e02f9a580e..c417184bde 100644 --- a/src/xref2/test.md +++ b/src/xref2/test.md @@ -372,7 +372,7 @@ by the module type `N`. However, `N` is not defined at the top level here, so it has a local identifier. We can see this by looking up module `M` from the environment: ```ocaml env=e1 -# let m = Env.(lookup_by_id s_module_type) (`ModuleType (Common.id, Odoc_model.Names.ModuleTypeName.of_string "M")) env;; +# let m = Env.(lookup_by_id s_module_type) (`ModuleType (Common.id, Odoc_model.Names.ModuleTypeName.make_std "M")) env;; val m : Component.Element.module_type option = Some (`ModuleType @@ -743,7 +743,7 @@ look up module `N` from within this and find its signature: ```ocaml env=e1 # let m = get_ok @@ Tools.lookup_module ~mark_substituted:true env - (`Module (`Module (`Identifier (Common.root_module "C")), ModuleName.of_string "N"));; + (`Module (`Module (`Identifier (Common.root_module "C")), ModuleName.make_std "N"));; val m : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some