Commit Graph

165 Commits (502e4f9336c03e21442404fd1beba79df824d32d)

Author SHA1 Message Date
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Jeremie Dimino 86daba0e90 Add Toploop.override_sys_argv 2016-03-01 10:36:24 +00:00
Jeremie Dimino b98461c3f3 Add Misc.protect_refs 2016-03-01 10:36:24 +00: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
Gabriel Scherer 6c91699c6f 'Hint: Did you mean' on misspelled toplevel directives 2015-12-25 20:58:51 +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
Xavier Leroy 8e6606d729 PR#6108, PR#6802: fail cleanly if dynlink.cma or ocamltoplevel.cma are loaded inside the toplevel loop 2015-12-06 12:59:23 +01:00
Damien Doligez cce9cb4546 fix `ocaml -stdin` (was broken by 0296d022) 2015-12-04 16:20:55 +01:00
Hugo Heuzard 9eca3e4519 Parse arbitrary precision integers ..
.. and allow any letter in [g-zG-Z] as modifier (previously 'l','L','n')
Also allow modifier for floats
This give more freedom to ppx rewritters (what about a ppx for zarith)

Checks are performed when translating from Parsetree to Typedtree.
Invalid_literal is raised if the modifier is not recognized ([lLn]?)
Integer_overflow is raised as before.

Lexer: use g-zG-Z for integer literal modifier

Lexer: Allow modifier on float

Clean wrt previous commits

Lexer: use named substring

Cleanup

typo

doc

fix after rebase

rebase on  trunk

Update typecore.ml

Fix printast.ml
2015-12-03 17:20:48 +01:00
alainfrisch 837bcd6e7b PR#6396: Warnings-as-errors not properly flushed in the toplevel. 2015-12-03 14:31:46 +01:00
alainfrisch 9879d54989 #6865: restore previous behavior for 'let _ = expr' in the toplevel, i.e. it prints the result of 'expr'. 2015-12-03 09:26:36 +01:00
alainfrisch a79825f7a6 #6401: use proper error reporting for toplevel's environment initialization (original patch from Gabriel Scherer). 2015-12-02 16:59:30 +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 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +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
Damien Doligez 0296d022e1 PR#6081: ocaml should add script's directory to search path, not current directory
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15779 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-16 22:45:06 +00:00
Gabriel Scherer f15f4f3ed8 PR6695: Make sure the compiler only uses ASCII string functions.
This should cover all places involving filenames in the compiler.
There are a few more paths still using Latin-1 in other ways,
e.g. in ocamldoc.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15727 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:14 +00:00
Gabriel Scherer 9d01c60c3a toplevel: allows the extension of 'genprintval.ml' with parameterised printer.
From: Pierre Chambart <pierre.chambart@ocamlpro.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15632 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-06 17:11:04 +00:00
Alain Frisch 56782ae7bc #6609: export Toploop.phrase.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15528 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-13 07:17:10 +00:00
Alain Frisch 37f4743986 Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15459 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:59:37 +00:00
Alain Frisch 44c2066055 #5904: improve support for ppx in the toplevel by allowing ppx processors to keep information across calls (through the use of persistent cookies). Also change Ast_mapper.register so that the function that creates the mapper from arguments is executed once the context has been restored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15314 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23 14:54:01 +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 047e09748c Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:46:34 +00:00
Xavier Leroy bb83542732 Reflecting commit 14976 on version/4.02:
PR#6211: in toplevel interactive use, bad interaction between uncaught
exceptions and multiple bindings of the form "let x = a let y = b;;".


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14977 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 15:14:41 +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
Jacques Garrigue 95104b3924 revert commit 14719
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 06:19:55 +00:00
Mark Shinwell 521ac0213a weak dependencies with -trans-mod (github/ocamllabs/weak-depends 45e980a,21856a7,merge)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 12:50:20 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Alain Frisch d2de0d7b18 Revert 14616, 14617. Go back to the original syntax for toplevel directives, only allowing capitalized identifiers in addition to lowercase ones. Split #show into variants #show_val, #show_type, etc, and implement a generic #show which combines all the results.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14697 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-28 08:04:43 +00:00
Alain Frisch 3775a101e6 Avoid bad error report when a registered toplevel primitive raises Not_found.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14671 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-23 16:18:22 +00:00
Alain Frisch 26a8bc20a7 Support for toplevel primitives with multiple arguments.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14616 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 16:51:37 +00:00
Jacques Garrigue 7a904bb8db make path normalization safer; now Core not only compiles but works
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14212 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 02:06:40 +00:00
Alain Frisch cc31694f7c Keep attributes on module declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 17:05:39 +00:00
Alain Frisch 884ca00fdf Continue cleanup. driver/errors.ml is no longer needed.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:45:03 +00:00
Alain Frisch 842f6794a9 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@14042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-28 17:10:04 +00:00
Gabriel Scherer b1c5fa3e52 PR#6071: Add a -noinit option to the toplevel [patch by David Sheets]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-04 19:58:09 +00:00
Alain Frisch 525ef9d703 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Fabrice Le Fessant ad6c285818 Improved implementation of OCAMLPARAM
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-05 16:34:40 +00:00
Jacques Garrigue f35c7d123f Take ambiguity into account when using -short-paths option.
Namely, do not use an abbreviated form which doesn't correspond
directly to a physical definition when it might point to
several definitions, due to multiple opens.
Also be careful about not abbreviating types we are defining
in type definitions.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13635 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-30 09:05:26 +00:00
Alain Frisch 04de43bee5 Attributes on Pstr_eval.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 14:07:32 +00:00
Alain Frisch b0987fd693 Attributes on expresions (etc) are now stored in the expression record, to facilitate pattern matching on structured fragments of AST while ignoring attributes. Introducing a new Ast_helper module to help creating AST fragments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13381 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 14:59:45 +00:00
Alain Frisch d32b19008a Parse recursive module as standard modules, and check in the type-checker that an explicit type is provided. (Unfinished.)
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-05 16:50:05 +00:00
Jacques Garrigue 26e1ff7138 Merge short-paths into a fresh branch of trunk.
Also fix a bit unification and subtyping errors.
You now need the flag -short-path to activate short paths.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths-4.01@13285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-29 14:21:12 +00:00
Alain Frisch ef9fc7ab0f #5904: support for -ppx in the toplevel.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13278 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-25 09:12:31 +00:00
Alain Frisch f1d0e5afab Add a -dtypedtree flag to all tools (using Printtyped). Also fix ocamlnat.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13139 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-18 17:19:53 +00:00
Wojciech Meyer bda692b6da PR#5825: Add a primitive to use source file wrapped in the coresponding module.
Patch by Grégoire Henry!

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13097 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-18 16:16:50 +00:00
Alain Frisch dfa500533a #5741: make Pprintast available from the command-line (-dsource).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13025 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-17 16:09:38 +00:00