Commit Graph

496 Commits (8db1b59233ab1127f7d634b06f975bbc4beaea08)

Author SHA1 Message Date
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 46d5d4e48f #6832: get rid of legacy file utils/config.mlbuild. 2015-12-03 13:37:44 +01:00
Jeremie Dimino ebd830b85b Add support for [%ocaml.extension_constructor <path>]
Translate [%ocaml.extension_constructor <path>] to the
runtime-representation of the extension constructor denoted by
<path>. This allows one to get the extension constructor without
having to create a dummy value.
2015-11-27 18:17:14 +00:00
Damien Doligez 7cb9a80744 simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo 2015-11-06 16:25:05 +01:00
Leo White 74215da003 Fix PR6998 2015-11-04 11:01:33 +00:00
Jacques Garrigue a335b18a45 merge branches/gadt-warnings
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16532 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 08:33:44 +00:00
Mark Shinwell e27e699fca GPR#173: Attributes to control inlining
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16530 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 08:18:08 +00:00
Jacques Garrigue e34f40ad87 switch to 'pat -> .' and add P/Texp_unreachable
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 00:13:40 +00:00
Jacques Garrigue b784b65925 add distinct warning for unreachable cases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16504 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:39:59 +00:00
Alain Frisch a21eaeaa40 GPR#254: @ocaml.arg_on_literal_pattern attribute on constructors
to warn when the argument is matches against a constant pattern.
This attributes is applied on predefined exception constructors
which take an purely informational (with no stability guarantee)
message.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 12:30:10 +00:00
Jacques Garrigue a09fb037ac add refuted cases, syntax is 'pat -> _'
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 01:55:52 +00: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
Jérémie Dimino 1d196f4ddd Support [@unboxed] and [@untagged] attributes
Adding [@unboxed] (resp [@untagged]) on a primitive argument means
that the argument must passed unboxed (resp untagged) to the external
function. Adding [@unboxed] (resp [@untagged]) on the result means
that the external function returns its result unboxed (resp untagged).

The unboxing (resp untagging) method is derived from the type.

Currently unboxing is suported for: float, int32, int64 and nativeint.
Untagging is supported for int.

This patch also increases the cm{i,o,a,x,xa} magic numbers as the type
Primitive.description is changed.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 16:18:46 +00:00
Gabriel Scherer cb3bb152ab add option handling for colors in compiler, OCAMLPARAM and ocamlbuild
(Simon Cruanes and Gabriel Scherer)

Use one of
  -color auto
  -color always
  -color never

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16348 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:51 +00:00
Gabriel Scherer 5893536b14 add Color module Misc
(Simon Cruanes)

We use bold magenta for warnings, because it works on terminals with
white background.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16347 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:49 +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
Leo White 5c55e4cc08 Attach documentation comments to Parsetree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16189 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-28 13:11:50 +00:00
Gabriel Scherer e9785253b2 PR#6876: improve warning 6 by listing the omitted labels.
(Eyyüb Sari)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-24 07:33:32 +00:00
Gabriel Scherer f9ea209cb7 GPR#171: allow custom warning printers / catchers
(Benjamin Canou, review by Damien Doligez)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16049 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-26 21:05:26 +00:00
Alain Frisch 918f584b64 #6845: -no-check-prims to tell ocamlc not to check primitives in runtime.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16031 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-22 10:53:47 +00:00
Gabriel Scherer 90061455e6 GPR#111: `(f [@taillcall]) x y` warns if `f x y` is not a tail-call
(Simon Cruanes)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16010 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-12 18:26:38 +00:00
Jérémie Dimino e0e02b8b05 Bump ast magic numbers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15920 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:08:13 +00:00
Gabriel Scherer 41e0ecf2ef PR#6642: replace $CAMLORIGIN in -ccopt with the path to cma or cmxa
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-08 11:18:29 +00:00
Gabriel Scherer 81e8d5bdbb Cmm arithmetic optimisations.
Constant additions and tagging operations are moved out of
subexpressions when possible. Often they can be merged.

From Stephen Dolan:
  https://github.com/ocaml/ocaml/pull/17

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-07 11:32:12 +00:00
Gabriel Scherer a4029d876b PR#6720: propagate -g to the C compiler
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15795 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-24 16:35:32 +00:00
Gabriel Scherer eca0967403 PR#6167: OCAMLPARAM support for disabling PIC generation ('pic=0')
(Gabor Pali)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15793 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-24 16:35:26 +00:00
Gabriel Scherer f256b3733d minor: cut too-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15735 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 12:18:10 +00:00
Gabriel Scherer 1d8e590c54 PR#6475: accept -o in ocamlc when compiling C files
(Vincent Laporte, Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15734 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 12:18:07 +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 843f152505 simplify the spellcheck functions
- expose the core spellchecking functionality in Misc rather than Typetexp
- remove the too high-order (yet insufficiently parametric)
  Typetexp.spellcheck from the public interface
- rewrite the spellchecking functions for variants and fields in
  Typecore from the Misc functions rather than reusing
  Typetexp.spellcheck

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:16 +00:00
Damien Doligez 4ea28ba75f fix typo in help text
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15644 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-09 22:07:49 +00:00
Alain Frisch 8c075ad80a Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15610 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-27 16:43:24 +00:00
Gabriel Scherer 7fa3f30114 update magic numbers
Numbers and .mlbuild and .mlp were not always synchronized; I only
changed the typedtree-related numbers, but used the max of both +1 on
both sides -- the .cm{o,a,x}... numbers are still non-synchronized.

From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15586 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-17 12:19:17 +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 856122459e Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15173 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 08:43:08 +00:00
Xavier Leroy 132c529b75 Reflecting commit 15169 on version/4.02:
PR#6529: fix quadratic-time algorithm in Consistbl.extract.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-31 14:44:51 +00:00
Damien Doligez a18bc7950b merge changes of version/4.02 from r15121 to r15155
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-29 17:14:00 +00:00
Alain Frisch e7ba464587 Add intel_proc.mli, get rid of arch64 bool ref, move StringSet/StringMap to misc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-29 14:35:10 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Gabriel Scherer d02c8fbc55 new -opaque flag: ocamlopt creates .cmx without cross-module info
(Patch by Pierre Chambart and Gabriel Scherer)
(Ack'ed by Damien Doligez)

This enables a form of incremental compilation for ocamlopt: if
A depends on B, and B is compiled with `ocamlopt -opaque`, then minor
implementation changes in B that do not affect the module interface
will not require recompilation of A.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-18 13:28:34 +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
Jacques Garrigue ccce272966 commit o_and_opens.diff
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14787 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 00:17:05 +00:00
Alain Frisch bfccd68ecc Protocol to allow ppx processors to report warnings to the compiler (reported as warning 22).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:52:19 +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 b78b19975a * Do not require cmi file to be present if module alias is not accessed
(using -trans-mod)
* Add warning 49 for that case; use same warning in place of deprecated
  for Env.scrape_alias


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14724 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 07:07:09 +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