-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended open #393
Extended open #393
Conversation
Signed-off-by: Jon Ludlam <jon@recoil.org>
Signed-off-by: Jon Ludlam <jon@recoil.org>
We do this by introducing an artificial module at the point the `open` occurs. For example: ```ocaml open (Foo : module type of Foo with module A := Foo.A) ``` becomes effectively: ```ocaml (**/**) module Open__<line>_<col> : module type of Foo with module A := Foo.A (**/**) ``` and we 'open' this by putting all of the identifiers into the environment. All of these `Ident.t` values are associated with 'Internal' names that are always hidden, and hence the resolution step ends up resolving them to the non-hidden identifiers. It is an error to try and turn the 'Internal' identifiers back into strings in the HTML generator to ensure they don't leak out into the documentation. Signed-off-by: Jon Ludlam <jon@recoil.org>
Until we can properly abstract types that refer to hidden items (ie, until the model rewrite lands), we'll allow these internal names to be exposed (prefixed with '$' to point them out). Signed-off-by: Jon Ludlam <jon@recoil.org>
Signed-off-by: Jon Ludlam <jon@recoil.org>
Looks like I've added a couple of binary files by mistake. I'll remove them when I'm back in front of my computer. |
Signed-off-by: Jon Ludlam <jon@recoil.org>
Signed-off-by: Jon Ludlam <jon@recoil.org>
Signed-off-by: Jon Ludlam <jon@recoil.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor comments from me, but this looks fairly well bounded behind 4.08-specific checks and has sufficient test cases to merge.
Sorry for the delay, I'll try to review this tomorrow. |
Signed-off-by: Jon Ludlam <jon@recoil.org>
Most `open` statements don't create anything new, so in the majority of cases we can skip a chunk of work. Optimization pointed out by @trefis. Signed-off-by: Jon Ludlam <jon@recoil.org>
9a015f4
to
4d9bb39
Compare
- Don't use to_string_unsafe (yet) - Document that to_string doesn't currently raise exceptions - Extend test to ensure standard use of open isn't affected Signed-off-by: Jon Ludlam <jon@recoil.org>
CHANGES: Additions - Add option to turn warnings into errors (ocaml/odoc#398, Jules Aguillon) Bugs fixed - Emit quote before identifier in alias type expr (Fixes ocaml/odoc#391, Anton Bachin) - Handle generalized open statements introduced in 4.08 (ocaml/odoc#393, Jon Ludlam) - Refactor error reporting to avoid exiting the program in library code (ocaml/odoc#400, Jules Aguillon) - Build on OCaml 4.10 (ocaml/odoc#408, Jon Ludlam)
CHANGES: Additions - Add option to turn warnings into errors (ocaml/odoc#398, Jules Aguillon) Bugs fixed - Emit quote before identifier in alias type expr (Fixes ocaml/odoc#391, Anton Bachin) - Handle generalized open statements introduced in 4.08 (ocaml/odoc#393, Jon Ludlam) - Refactor error reporting to avoid exiting the program in library code (ocaml/odoc#400, Jules Aguillon) - Build on OCaml 4.10 (ocaml/odoc#408, Jon Ludlam)
Handle generalized open statements in cmt files.
For review, since I've not implemented the signature side of this yet. Now complete and ready to review.