Commit Graph

1203 Commits (547f9b8126fbb558de184a3424b0fc22a3d57f27)

Author SHA1 Message Date
Gabriel Scherer 89d6a2094b change or-pattern printing to use spaces instead of cuts
(A p1 | B p2 | C p3) instead of (A p1|B p2|C p3)
2020-11-03 22:17:16 +01:00
Gabriel Scherer bdcd9baa03 fix -dsource printing of the pattern (A as x | (B as x))
fixes #9999
2020-11-03 22:17:16 +01:00
Thomas Refis efac790249
Make some locations more accurate (#8987) 2020-10-14 16:03:10 +02:00
Leo White 44fff5c92a Add ppx-only unary operators 2020-09-18 10:33:16 +01:00
Chet Murthy 0d46b5206d redo: This little patch fixes the pretty-printing of "rebind" extension-constructors (and also rebind exceptions) so that it matches the parser. With tests. a rebind extension like
type t  += A = M.A [@a]
was pretty-printed as

type t += A[@a] = M.A
[obviously wrong, also not accepted by parser]

With tests for extension-constructors and exceptions.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-extension-constructor-rebind-pprint-4.11
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-10 11:09:06 -07:00
Chet Murthy e2ec81fe56 re-do of print polyvariants that start with a core_type,closed, not low with leading bar ("|").
a type "[ | w ]" must be printed with the "|", or it won't be
reparseable.

with tests, Changes entry.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-polyvariant-pprint
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/parsetree.mli
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-09 13:37:36 -07:00
Leo White ccf4df0758
Remove spurious Ptop_defs from #use (#9376)
* Remove spurious Ptop_defs from #use

* Add Changes entry
2020-08-25 18:01:03 +01:00
Fourchaux 44e6cf4e0f
typos (#9806) 2020-07-28 12:22:03 +01:00
Nicolás Ojeda Bär a0cef9fdc6 Rename Bad_docstring => Unexpected_docstring 2020-07-20 08:31:18 +02:00
Matthew Ryan dd7ddf9e71
Fix printing of bindings with polymorphic type annotations and attributes (#9778) 2020-07-20 06:10:13 +02:00
Jacques Garrigue 603506aa34
Add injectivity annotations (#9500) 2020-06-15 13:51:50 +02:00
Etienne Millon 71e91123c2
Attach package type attributes to core_type (#9615) 2020-05-29 14:29:10 +02:00
Nicolás Ojeda Bär 9b748843bb
Use List.find_map (#9589) 2020-05-21 08:51:16 +02:00
Stephen Dolan a5292808d2 Introduce the Lambda.scoped_location type 2020-04-27 12:51:46 +01:00
Leo White a534650f41 Add locations to docstring attributes 2020-04-17 09:21:31 +01:00
Pieter Goetschalckx 99224a96b7
Quoted extensions in comments, ocamllex and ocamlyacc (#9166)
* Support quoted extensions in comments
* Support quoted extensions in ocamllex
* Support quoted extensions in ocamlyacc
* Fix copying of comments in ocamlyacc
2020-02-03 10:55:28 +01:00
Florian Angeletti dc56d71b53 types: allow class type paths in #t 2020-01-20 17:21:02 +01:00
Gabriel Scherer 8a79f6ce59
Merge pull request #9021 from Octachron/longident_parser
Expose parsers for Longident.t
2020-01-10 11:23:09 +01:00
Florian Angeletti 40e40a9c20 compilerlibs: expose parsers for 'Longident.t's 2020-01-09 16:45:39 +01:00
Gabriel Scherer 8938886721 -dno-locations: hide source locations (and debug events) from IR dumps
This PR was tested with also the -dsel, -dlinear output (also fixed to
not-print locations), but the output is architecture-dependent so this
part of the test was removed.
2020-01-09 15:25:16 +01:00
Drup 9d9d74bc2e Move loc computation to the lexer. 2019-11-25 16:23:40 +01:00
Drup 00b40bca7e Rename utility functions for string and comment lexing. 2019-11-25 15:06:07 +01:00
Drup a699de30ff Rename tokens for quoted extensions. 2019-11-25 14:58:53 +01:00
Drup ef274e036c Fix lexing of longidents for quoted extensions. 2019-11-25 14:30:14 +01:00
Drup 4092d8fc49 Fix locations for quoted extensions ids. 2019-11-13 16:08:41 +01:00
Drup b507e7f235 Add constants to Ast_mapper. 2019-11-13 16:08:41 +01:00
Drup 9c8b63f4ce Annotated Asttypes.constant's string with content location. 2019-11-13 16:08:40 +01:00
Drup abc53d1a6e Annotate constant literals with the location of their content. 2019-11-13 16:08:40 +01:00
Drup 4f6a605635 Add quoted ppx extensions. 2019-11-13 14:54:28 +01:00
Drup ab589b1933 Factorize string lexing. 2019-11-13 14:54:28 +01:00
Thomas Refis 8e928caea7
a better representation for modules with no name (#8908) 2019-10-09 14:15:37 +01:00
Damien Doligez 454ee52984 Fix #8789 2019-10-04 15:25:26 +02:00
Jeremie Dimino 2d31ebfc8b Add support for [@@immediate64]
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01:00
Armaël Guéneau 3167a57bd5 Fix error submessages in the toplevel: do not display dummy locations
Fixes #8953
2019-09-19 15:42:32 +02:00
Armaël Guéneau c4109d6051 PR#8611: be more conservative (no assert false), and tweak some comments 2019-09-11 20:08:50 +02:00
Kyle Miller 03ddf295d5 Fix source highlighting for long toplevel phrases (#7925) (#8611)
Fix #7925: error messages for long toplevel inputs would have dummy locations
2019-09-11 20:07:34 +02:00
Gabriel Scherer 4c303cc88a Merge pull request #8826 from glondu/4.08-spelling-errors
Fix spelling errors reported by Lintian

(cherry picked from commit c808ce7068f3e31975594bcd5e6a41dceab3a80e)
2019-07-29 08:36:53 +02:00
hhugo e579129133 Add a type alias for location stack in the parsetree (#8803) 2019-07-12 12:18:28 +02:00
Leo White acd06f1eff Remove Misc.may_map and similar 2019-05-23 16:27:58 +01:00
octachron e7c72ed709 multi-indices for extended indexing operators 2019-05-13 15:26:49 +02:00
Pieter Goetschalckx af103fdbf4
Octal character literal in comments 2019-04-26 15:21:02 +02:00
Pieter Goetschalckx 4e09ec8bd2
Lex identifiers in comments 2019-04-26 15:19:22 +02:00
Nicolás Ojeda Bär 6bf02e0477 Pprintast: add parentheses around (lazy ...) pattern 2019-04-10 17:28:27 +02:00
Nicolás Ojeda Bär fdd015dcdc Pprintast: add parenthesis when printing Pexp_newtype 2019-04-10 17:28:27 +02:00
Louis Roché 4fee301280 Print end line and valid end character for multi-lines locations
When a location is related to multiple lines of code, it is printed
incorrectly. More specifically, the end character is actually an
offset between the beginning and the end of the location.

This commit changes the format of the locations when they cover
multiple lines. It adds the end line and the end character is now a
proper column rather than an offset. It doesn't affect locations
related to a single line.

The old format was:

```
Line STARTLINE, characters STARTCHAR-OFFSET
```

The new format is:

```
Lines STARTLINE-ENDLINE, characters STARTCHAR-ENDCHAR
```
2019-04-08 00:51:09 +00:00
Xavier Clerc f7f5f2112d Tweak the definition of Parsetree.Pexp_letop (#8535)
Avoid the use of inline records so that we can keep compatibility with 4.02 in ocaml-migrate-parsetree.
2019-03-21 14:09:35 +00:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01:00
David Allsopp 6e84987715 Restore -vmthreads flag as an error (#2312)
This GPR restores -vmthread with an adapted version of the deprecation message as an error message and also keeps the use_vmthreads part of ppx contexts.

* Partially revert #2289
* Convert -vmthread to an error
* Neuter use_vmthreads in ppx context
* Remove Clflags.use_vmthreads
2019-03-13 10:46:30 +01:00
Jérémie Dimino 705054b346 Delete the vmthreads library (#2289)
* Delete the deprecated vmthreads library

It was deprecated in 4.08.

* Remove the byte/native argument of init_path

It is no longer necessary.

* Error out when passing --{enable,disable}-vmthreads to ./configure

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-11 19:38:16 +01:00
David Allsopp 1626a018d8 Remove unnecessary executable bit from sources (#2270)
Various files which seem to have acquired Git executable bits.
File contents are unchanged; only permissions are changed.
2019-02-28 16:29:26 +01:00