Commit Graph

134 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 5381e13626
Fix handling of Exit_compiler exception in toplevel (#9798) 2020-10-05 09:46:20 +02:00
Jeremy Yallop 27f1012bc6 Revert to printing types as 'nonrec' to avoid a bug
See: https://github.com/ocaml/ocaml/issues/9828
2020-08-05 11:21:11 +01:00
Jérémie Dimino e54876a869
Add a new toplevel directive #use_output "<command>"
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
2020-03-16 17:48:41 +00:00
Thomas Refis d52dd5c33e Add a unique id to every signature item 2020-03-05 13:34:12 +01:00
Gabriel Scherer c76edb9677 [refactoring] use named fields for Consistbl.Inconsistency exception 2019-11-07 15:07:46 +01:00
Simon Parry f43323be52 Fix toplevel show directive to work with constructors
The show directive now has some basic facility to show
useful information for constructors of "normal" values,
exceptions and other non-exception extension constructors.

Also updated show_type to print out recursion status
with a default of Trec_first.
2019-11-05 20:02:03 +00:00
Leo White c19e8b2350 Refactor environment lookup functions 2019-08-15 15:56:50 +01:00
Mark Shinwell d47ba6ec18
Functorize Consistbl (with some background info on Compilation_unit.t) (#2286) 2019-03-07 16:19:51 +00:00
Gabriel Scherer a6f0caa8de env refactoring: avoid external uses of {add_import,crc_units}
There is a small change of behavior in this patch due to a different
handling of weak dependencies (those with crco=None); in
Env.check_consistency, only non-weak dependencies would get
[Env.add_import] called, while the `toplevel/` implementations would
also call [Env.add_import] on weak dependencies. After this patch, we
systematically call [add_import] only on non-weak dependencies, even
in `toplevel/`.

([Gabriel:] As far as I can see, the use of [add_import] in the
toplevel never leads to a use of [Env.imports()] for producing
a dependency list, as the toplevel does not produce cmi/cmo files; are
they just no-ops?)
2019-02-15 10:24:49 +01:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
Runhang Li 97329f30ed Extend `open` to arbritrary module expressions in structures and to
applicative module paths in signatures
2018-11-26 16:20:37 +00:00
Leo White 111d4e1827 Remove positions from paths 2018-11-21 03:39:34 -05:00
Thomas Refis 67f29d1a18 ident: add an explicit scope field
- Ident.create now takes a scope as argument
- added Ident.create_var to use when the scope doesn't matter
- the current_time and the current_level are unrelated as of this
  commit. But one has to remember to bump the level when creating new
  scopes.
2018-09-21 11:47:42 -04:00
Hugo Heuzard 8043144494 Add locations to attributes
Changes

fix typo
2018-08-06 13:19:28 +01:00
Nicolás Ojeda Bär 40bab2d768 Implement reviewer suggestions 2018-07-25 17:58:32 +02:00
François Bobot da3f9f34f5 Use reraise_raw_backtrace in Misc.try_finally
And add labels ~always for previous cleanup function and
    ~exceptionally for new cleanup function in exceptional case
2018-07-25 17:58:32 +02:00
Thomas Refis 445b53182a ctype: remove instance_def which is redundant 2018-07-25 11:12:10 +01:00
Stephen Dolan 26f78be56d Add an optional digest parameter to Meta.reify_bytecode. 2018-04-13 17:36:20 +01:00
Stephen Dolan 7f76b23531 Add LongString.blit_string 2018-04-13 17:11:37 +01:00
Stephen Dolan aa1dc8063a Remove Meta.static_{alloc, free}.
The bytecode runtime now represents code to be loaded as LongString.t,
rather than as a naked pointer to a bytecode block.

(This commit breaks Dynlink of bytecode, due to an issue about digests)
2018-04-13 16:29:33 +01:00
Jacques Garrigue 3d33bd4ef5
Fix MPR#7751 (#1657)
Fix the toplevel printer, to have it properly load needed cmi's.
2018-03-27 09:25:28 +09:00
Adrien Nader de82de7611 toplevel: doc for #show mentions categories above while they're below.
The toplevel output for #help seems to be sorted and looks like:

  #show <ident>
    Print the signatures of components from any of the above categories.
  #show_class <ident>
    Print the signature of the corresponding class.
  #show_class_type <ident>
  [...]

Thus the documentation for #show needs to say that the categories are
below, not above. The code is effectful and has the specific #show_*
directives before the general #show one. That's why I expect there is
some kind of sorting done at runtime.
2017-05-08 15:16:28 +02:00
Florian Angeletti 907c49d4d6 fix potential alias loop in #show_module (#777) 2016-12-14 13:14:21 +00:00
Leo White caadb9de8a Allow more module aliases in strengthening 2016-07-28 10:13:32 +01:00
Gabriel Scherer 29b9b271e4 MPR#7189: toplevel #show, follow chains of module aliases
Before this patch,

    module A = struct let x = 1 end;;
    module B = struct module M = A end;;
    module C = B.M;;
    module D = C;;
    #show D;;

would print

    module D = C

now it prints

    module D = C
    module D = B.M
    module D = A
    module D : sig val x : int end

Note that one might expect to read

    module D = C
    module C = ...

instead, but this would result in the next line being

    module B.M = ...

which is not syntactically correct.

Note that this approach could be generalized to other forms of
aliases-following, types in particular.
2016-06-30 06:51:33 -04:00
Jacques Garrigue 3cb6d6c702 PR#7233: GADT equations for non-local abstract types 2016-06-13 09:25:31 +09:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
octachron 213f51a77b Manual: synchronize the manual and toplevel help 2016-02-11 16:56:16 +01:00
Gabriel Scherer d7dfe9604e toplevel #help: split the directives into several sections 2015-12-25 19:53:27 +01:00
Gabriel Scherer 43c31e4f08 Add #help directive to the toplevel.
Nick Giannarakis proposed a first patch at
  http://caml.inria.fr/mantis/view.php?id=6113

Berke Durak and Francis Southern proposed two iterations on the patch
at:
  https://github.com/ocaml/ocaml/pull/46
  https://github.com/ocaml/ocaml/pull/376

The present patch contains code and ideas from all three sources.
2015-12-25 19:53:27 +01:00
alainfrisch f6b5c9d579 Fix #7101: double file opening when loading .cmo/.cma in the toplevel leads to fd leak. 2015-12-18 15:54:48 +01:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Damien Doligez 1326b12f74 merge branch 4.02 from rev 16205 to rev 16238
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16296 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-29 22:19:24 +00:00
Gabriel Scherer 304c9c91a5 PR#6468: toplevel now supports backtraces if invoked with OCAMLRUNPARAM=b
(Peter Zotov and Jake Donham,
 review by Gabriel Scherer and Jacques-Henri Jourdan)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15830 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-08 14:10:12 +00:00
Jacques Garrigue df4916451b Fix PR#6763
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15798 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-30 02:02:28 +00:00
Jacques Garrigue 158480371a exhauce PR#6367: introduce Asttypes.arg_label to encode labelled arguments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 08:45:55 +00:00
Gabriel Scherer 5f58cc7d3f toplevel: generic printers are only allowed with 'new' printer style.
From: Pierre Chambart <pierre.chambart@ocamlpro.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15634 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-06 17:11:09 +00:00
Gabriel Scherer bdaf4c3cf5 toplevel: extends #install_printer to accept parameterised printers
From: Pierre Chambart <pierre.chambart@ocamlpro.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15633 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-06 17:11:07 +00:00
Jacques Garrigue 5adbb67a45 PR#6648: show_module should indicate its elision (add Osig_ellipsis to outcometree)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15573 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-10 09:09:23 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Alain Frisch e3ad818fb5 Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-14 15:51:30 +00:00
Alain Frisch 378a967cb7 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-04 16:11:12 +00:00
Alain Frisch adcd0fe5c9 #6529: further optimize consistency check.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 08:36:47 +00:00
Alain Frisch 50f47df33a Sync with trunk. Rebinding of inlined extension constructors with free variables is not yet supported.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 16:07:55 +00:00
Mark Shinwell 60d0af57c4 merge from 4.02: rev. 14858, Adding #ppx toplevel directive (patch by Peter Zotov, github #54).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14928 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-30 12:10:06 +00:00
Jacques Garrigue 77cf8b999e * split Typetexp.lookup_module and Typetexp.find_module
* fix semantics of -open by using Typemod.type_open_


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14795 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:02:26 +00:00
Jacques Garrigue 1ce29d9bfc re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Jacques Garrigue b56dc4b3df PR#5584: merge open extensible types, extension-patch-4.0.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00