summaryrefslogtreecommitdiffstats
path: root/parsing
AgeCommit message (Collapse)Author
2015-01-30Fix pretty-printing of inlined recordsJérémie Dimino
Attributes on label declarations were ignored git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-09Merge https://github.com/ocaml/ocaml/pull/134: Fix (and simplify) pprintast ↵Alain Frisch
for optional arguments in types. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15772 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-07Fix #6679 (pprintast bug around constraint).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-23PR#6663: A misleading typo in parsetree.mliDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22Exhauce PR#6611: remove the option wrapper on optional arguments in the ↵Jacques Garrigue
syntax tree git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22exhauce PR#6367: introduce Asttypes.arg_label to encode labelled argumentsJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16notes on attributes in pprintast.mlGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15678 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16PR#6717: Pprintast does not print let-pattern attributesGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13remove unnecessary Obj.magic (Grégoire Henry)Gabriel Scherer
From: Gabriel Scherer <gabriel.scherer@gmail.com> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15664 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13Simplify the definition of custom .{} operatorsGabriel Scherer
This commits modify the Bigarray syntax extension in order to facilitate the use of custom .{} operators. The compatibility with the existing Bigarray syntax has been preserved as much as possible. However, this commit will break code which use the Bigarray .{} syntax without opening the Bigarray module first! Like the previous commit, this commit modifies the parser to desugar bigarray1.{index} to ( .{} ) bigarray1 index. Following the bigarray syntax, the index operator used in the desugaring changes if the index is a n-tuple: 1-tuple => .{} 2-tuple => .{,} 3-tuple => .{,,} 4 and more tuples => .{,..,} The bigarray modules has been modified to use this new index operators. Note that this means that these index operators are not anymore accessible without opening the bigarray module. From: octachron <octa@polychoron.fr> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13Simplify the use of custom .() and .[]Gabriel Scherer
This commit modifies the parser to use the newly defined .() and .[] operators. It also moves the definition of the standard .() and .[] operator for String/Bytes and Array to the pervasives module. Before this commit, expressions of the form array.(index) and string.(index) where desugared to Array.get[_unsafe] array index and Strinf.get[_unsafe] string index. The unsafe or unsafe version were chosen depending on the presence of the "-unsafe" compiler option. Such expression are now desugared to ( .() ) array index and ( .[] ) string index respectively. The same desugar operation is applied to array.(index) <- value which becomes ( .()<- ) array index value. In order to keep the standard semantic for the string and array index operations, these new index operators are defined in the pervasives module using new compiler primitives, e.g. let .() = "%array_opt_get". These new primitives are then mapped to safe or unsafe version depending on the the "-unsafe" compiler option. Consequently, these modifications should have no impact on existing code. With these modifications, defining custom .() and .[] operators should be easier, at the cost of losing access to the standard index operator for either array or string. From: octachron <octa@polychoron.fr> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13Add a special syntax for index operatorsGabriel Scherer
This commit introduces a new syntax for index operators. Six core parenthesis operator are added: .(), .[], .{}, .{,}, .{,,}, .{,..,}. The .{,}/.{,,}/.{,,,} operators are defined for compatibility with the Bigarray syntax extension. Each core index operator is available in a access/assignement versions. For instance, .() is declined in * .() : index operator * .()<- : indexed assignment operator The general syntax for these index operators as implemented in the parser is index_operator::= index_operator_core [<-] From: octachron <octa@polychoron.fr> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15660 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-10#6688: fix comment.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15646 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-10#6688: allow val declarations as structure items.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15645 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-16Add punning for object copying expressions.Gabriel Scherer
From: Jeremy Yallop <yallop@gmail.com> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15580 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-17Fix PR#6615: inconsistent printing and parsing of inline recordsJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15559 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15merge branch 4.02 from release 4.02.0 to release 4.02.1Damien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-14Reintegrate-merge constructors_with_record5 branch.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09Factorize code to print constructors.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15508 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-04Document -ppx option.Gabriel Scherer
From: Peter Zotov <whitequark@whitequark.org> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26Get rid of type-qualifed constructor paths for extensible types.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25Sync with trunk.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15334 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25Make it clear that type-qualified constructors are only allowed in bang types.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25Allow qualified reference to constructors (at least in bang-types). A ↵Alain Frisch
regular variant type supports qualified constructors of the form: M.t.X. An extensible variant type supports qualified constructors of the form: M.t.N.X. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23Refer to the inlined record type as !M.Foo for a constructor M.Foo.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23#5904: improve support for ppx in the toplevel by allowing ppx processors to ↵Alain Frisch
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-04Sync with trunk.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev ↵Damien Doligez
15121) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12#5528: -dsource printer, also fix a bug (present in trunk) when printing ↵Alain Frisch
GADT constructors with multiple arguments. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15082 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07Sync with trunk. Rebinding of inlined extension constructors with free ↵Alain Frisch
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-07Cherry-pick 15062,15063,15064 from 4.02 (#6497).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07Cherry pick commit 14900 from 4.02 (fix some whitespace and add a few ↵Alain Frisch
copyright headers), only the in parsing/ subdirectory (it creates conflicts elsewhere). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15067 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07Cherry pick commit 14989 from 4.02 (#6463: properly propagate errors raised ↵Alain Frisch
when creating the mapper (typically, invalid arguments) to the compiler.). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15066 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07Cherry pick commit 14857 from 4.02.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-11PR#6469: -dsource prints Pervasives.(!) as Pervasives.!Damien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14998 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-03Fix regression introduced by commit 14809. (Cherry pick commit 14946 from ↵Alain Frisch
version/4.02.) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14947 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12temporarily remove %(%) to avoid weaker typingGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14809 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07Protocol to allow ppx processors to report warnings to the compiler ↵Alain Frisch
(reported as warning 22). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07Minor tweak to raw dump of parsetree/typedtree.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07#6399: protocol (based on a built-in ocaml.error extension node) to let ppx ↵Alain Frisch
tools send located errors to be reported by the compiler (patch by Peter Zotov). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06PR#6397: fix infix (+=) operators after open types mergeGabriel Scherer
(Patch by Leo White) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14754 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05Whitespace.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05#6318: Extend match...with with exception cases. (Patch by Jeremy Yallop, ↵Alain Frisch
backend part by A. Frisch). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05#6387: also allow attributes on methods in object types (< m [@foo] : int; ..>).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05Whitespace.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14740 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04PR#5584: merge open extensible types, extension-patch-4.0.2Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04Add support for floating attributes in class structures and class ↵Alain Frisch
signatures. (Patch by Leo White.) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30#6387: allow attributes on variants in polymorphic variant types.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14712 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30Fix precedence of extension nodes (#6386).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14711 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30Fix precedence of extension nodes (#6386).Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14710 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02