Commit Graph

150 Commits (7ad32890fe51263c719ece037707081a9e373186)

Author SHA1 Message Date
Fabrice Le Fessant a424f0aae1 Add missing locations in the parsetree (#749)
They are not propagated to the typedtree yet.
2016-08-29 16:21:38 +02:00
Gabriel Scherer 98472dfdf6 Merge pull request #773 from Octachron/fix_dsource_local_open_in_pattern
PR#7329, fix "-dsource" for local open in patterns
2016-08-20 10:28:08 +02:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Runhang Li 63c2151669 PR#7200: fix more bugs. 2016-05-16 22:45:16 -07:00
Runhang Li 0ab05ee057 Replace class printer with mutual recursive fn. 2016-05-16 22:45:16 -07:00
Damien Doligez 520fb2df50 Merge tag 4.03.0 into trunk. 2016-04-28 16:13:21 +02:00
Damien Doligez 2605f7798e PR#7232: Strange Pprintast output with ppx_deriving 2016-04-19 14:41:43 +02:00
alainfrisch 7542c34f1d Correctly print declarations of the (::) constructor. 2016-03-30 14:58:15 +02:00
alainfrisch 5e68ddd093 #7200: print [>] correctly in Pprintast. 2016-03-30 14:45:44 +02:00
alainfrisch 1cb39a2ba2 #7200: in Pprintast, avoid turning ~-1 into -1 which would be parsed as an int literal. 2016-03-30 14:34:12 +02:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Alain Frisch f4a29c6ca2 Merge branch '4.03_merged_in_trunk' of https://github.com/bobot/ocaml into bobot-4.03_merged_in_trunk 2016-03-15 22:09:24 +01:00
alainfrisch 43f90e9f58 Local let exceptions. 2016-03-15 22:02:55 +01:00
François Bobot 2aec849922 Merge remote-tracking branch 'origin/4.03' into trunk
travis.yml is kept from trunk

Conflicts:
  	.depend
	Changes
	Makefile
	VERSION
	boot/ocamlc
	boot/ocamldep
	boot/ocamllex
	parsing/parser.mly
	parsing/pprintast.ml
	stdlib/hashtbl.ml
	testsuite/tests/unwind/Makefile
	tools/check-typo
2016-03-11 18:44:32 +01:00
Damien Doligez df75e7e9de cut overlong lines 2016-02-25 16:51:40 +01:00
KC Sivaramakrishnan e21ad4fdcf Minor prettify pretty printing of tuple types and constructor declaration 2016-02-25 13:59:54 +00:00
Jeremie Dimino 9614fca1ef fix printing of prefix operator applications
Fix printing of prefix operator applications with multiple arguments
and/or labelled arguments.

Old output (invalid syntax):

  ! 1 2 3
  ! ~a:42

New output:

  (!) 1 2 3
  (!) ~a:42
2016-02-25 10:37:14 +00:00
Spiros Eliopoulos c80f20a8d3 fix printing of operator applications with labeled arguments
When infix operators are defined to have labeled arguments, such as:

  let (++) ~n1 ~n2 = n1 + n2

... applications of the infix operator using labeled arguments like
this:

  (++) ~n1:10 ~n2:20

would be printed out like this, which is a syntax error:

  ~n1:10 ++ ~n2:20
2016-02-25 10:37:14 +00:00
Jeremie Dimino 7245742974 fix printing of prefix operator applications
Fix printing of prefix operator applications with multiple arguments
and/or labelled arguments.

Old output (invalid syntax):

  ! 1 2 3
  ! ~a:42

New output:

  (!) 1 2 3
  (!) ~a:42
2016-02-25 10:33:28 +00:00
Spiros Eliopoulos fae63549cc fix printing of operator applications with labeled arguments
When infix operators are defined to have labeled arguments, such as:

  let (++) ~n1 ~n2 = n1 + n2

... applications of the infix operator using labeled arguments like
this:

  (++) ~n1:10 ~n2:20

would be printed out like this, which is a syntax error:

  ~n1:10 ++ ~n2:20
2016-02-25 10:21:43 +00:00
Spiros Eliopoulos 7c2d0ebbde Fix printing of type delcs that use 'private' keyword
type t = private A | B
  type u = t = private A | B

Was previously printed out as:

  type t = private A | B
  type u = private t = A | B
2016-02-24 13:29:49 +00:00
Spiros Eliopoulos 7543d73d83 Fix printing of type delcs that use 'private' keyword
type t = private A | B
  type u = t = private A | B

Was previously printed out as:

  type t = private A | B
  type u = private t = A | B
2016-02-24 13:28:51 +00:00
Jeremy Yallop a8498a82f5 Fix printing for constrained infix operator bindings:
let (++) : _  = (+)

was previously printed as

   let ++ : _  = (+)
2016-02-23 14:32:49 +00:00
Jeremy Yallop 5ce273b2e0 Fix printing for constrained infix operator bindings:
let (++) : _  = (+)

was previously printed as

   let ++ : _  = (+)
2016-02-22 19:59:02 +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
Drup 6095df954e Rename parsetree constants.
PConst -> Pconst
int -> integer
2016-01-18 00:12:38 +01:00
Nicolas Ojeda Bar c242a29b12 Compile with -principal 2016-01-14 15:29:41 +01:00
Drup ba8eb65195 Slight improvements to pretty printing of attributes. 2016-01-08 03:05:02 +01:00
Drup 4f6e4144ff Add signature payloads for extension and attributes. 2015-12-09 14:26:06 +01:00
Gabriel Scherer c6b5a28d77 Merge pull request #320 from gasche/revert-user-defined-indexing-operators
Revert user defined indexing operators
2015-12-06 17:56:40 +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 01bf671f33 PR#6865: remove special case for "let _ = expr" structure items.
This form used to produce Pstr_eval instead of Pstr_let.  This would
probably come as a suprise for people matching on the Parsetree (e.g.
for a ppx).  This special case is now removed.

To avoid a (probably harmless) regression in bytecode, the compilation
of "let _ = ..." bindings (including local ones) is optimized to remove
a useless introduction of a variable (which would occupy a stack slot
otherwise).

The source code printer (-dsource) now prints Pstr_eval as ";;expr",
which should always be ok.  One could avoid ";;" at the beginning of
the structure, but since it is allowed, it is probably not worth adding
complexity here.
2015-12-02 23:39:19 +01:00
Jeremie Dimino 07f5fa92a1 Revert "Update printing of custom index operators"
This reverts commit 7a318f1a64.

(This patch was hand-written to keep some refactoring done in the
reverted patch.)
2015-11-30 16:06:30 +01:00
Jeremie Dimino 7a318f1a64 Update printing of custom index operators 2015-10-28 14:36:10 +00:00
Gabriel Scherer 54e039901e GPR#42: Add simpler functor type syntax
(Leo White)

Add support for simple functor types of the form:

    S -> T

equivalent to:

    functor (_ : S) -> T

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16546 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 16:24:47 +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
Alain Frisch 923ad0ec47 Remove or comment-out dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16515 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 16:08:12 +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 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
Gabriel Scherer 60314e38c5 fix -dsource error on recursive modules
(Hongbo Zhang)

when printing recursive module the old version would print no space
before 'and':
  A : ... = struct
    ...
  endand B : ... = ...

this tiny PR fixes such problem

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16307 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 13:05:53 +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
Jérémie Dimino 050a57649a Fix pretty-printing of extensions in patterns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15945 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-16 18:15:03 +00:00
Jérémie Dimino 7ae6f92e5d Add the "nonrec" keyword and allow it on type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:07:57 +00:00
Alain Frisch 4c48d802cb #6612: attribute in type expressions bind less then product types; attributes come after constructor/field declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-11 14:57:20 +00:00
Jérémie Dimino dc7e685a40 Fix pretty-printing of inlined records
Attributes on label declarations were ignored


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-30 16:24:18 +00:00
Alain Frisch 9bf9d90258 Merge https://github.com/ocaml/ocaml/pull/134: Fix (and simplify) pprintast for optional arguments in types.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15772 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-09 08:31:46 +00:00
Alain Frisch 1be542d948 Fix #6679 (pprintast bug around constraint).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-07 11:34:03 +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