Skip to content

Commit

Permalink
a few modifications
Browse files Browse the repository at this point in the history
Signed-off-by: lubegasimon <lubegasimon73@gmail.com>
  • Loading branch information
lubegasimon committed Feb 21, 2021
1 parent 4589202 commit d40779f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/model/ident_env.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ open Names

module Id = Paths.Identifier
module P = Paths.Path
open Typedtree

type type_ident = Paths.Identifier.Path.Type.t

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/model/names.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/xref2/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d40779f

Please sign in to comment.