SIGN IN SIGN UP
reasonml / reason UNCLAIMED

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems

0 0 36 OCaml
2016-02-19 16:36:03 -08:00
/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */
type t = {.};
2016-02-19 16:36:03 -08:00
type t = {
2016-11-30 11:15:56 +01:00
.
2016-02-19 16:36:03 -08:00
u: int,
2016-11-30 11:15:56 +01:00
v: int
};
2016-02-19 16:36:03 -08:00
2016-11-30 11:15:56 +01:00
type t = {.. u: int};
2016-02-19 16:36:03 -08:00
2016-11-30 11:15:56 +01:00
type t = {.. u: int};
2016-02-19 16:36:03 -08:00
type t = {
2016-02-19 16:36:03 -08:00
..
};
2016-02-19 16:36:03 -08:00
type t = {..};
2016-02-19 16:36:03 -08:00
Uniform parenthesized syntax for abstraction and application (#1299) * refactor only_core_type * refactor with menhir higher-order rules * replace more recursions (attributes, lists) by higher-order rules * introduce left-recursive equivalent of higher-order rules * factor constructor declarations, tuple rules, ... * styling, refactor flags * simple_expr_list -> simple_expr* * minor cleanup * replace mapper chain by a mapper composition GC stat after ============== parsing: allocated_words: 37657442 minor_words: 15582165 promoted_words: 2166069 major_words: 24241346 minor_collections: 103 major_collections: 24 heap_words: 7015424 heap_chunks: 20 top_heap_words: 7015424 compactions: 0 reformatting: allocated_words: 153497667 minor_words: 131135436 promoted_words: 36777601 major_words: 59139832 minor_collections: 553 major_collections: 41 heap_words: 9278464 heap_chunks: 22 top_heap_words: 9278464 compactions: 0 GC stat before ============== parsing: allocated_words: 41243812 minor_words: 19168535 promoted_words: 3911746 major_words: 25987023 minor_collections: 117 major_collections: 25 heap_words: 7015424 heap_chunks: 20 top_heap_words: 7015424 compactions: 0 reformatting: allocated_words: 159464070 minor_words: 137101839 promoted_words: 39600932 major_words: 61963163 minor_collections: 576 major_collections: 43 heap_words: 8068096 heap_chunks: 21 top_heap_words: 8068096 compactions: 0 * optimise replace_string GC stat after ============= parsing: allocated_words: 35870858 minor_words: 13795581 promoted_words: 2141052 major_words: 24216329 minor_collections: 96 major_collections: 24 heap_words: 7015424 heap_chunks: 20 top_heap_words: 7015424 compactions: 0 reformatting: allocated_words: 149597673 minor_words: 127235442 promoted_words: 36784443 major_words: 59146674 minor_collections: 539 major_collections: 42 heap_words: 395776 heap_chunks: 1 top_heap_words: 9278464 compactions: 2 * replace custom string buffer implementation by stdlib * refactor lexbuf copy Replace a global buffer by a buffer local to parsing code. This fixes a bug when processing multiple inputs. For instance with refmt a.re b.re, b.re comments will (incorrectly) be read from a buffer that begins with content from a. * Implement decorators * inline item_attributes * wip: introduce ES6_FUN token for ES6 arrow syntax * proof of concept es6 arrows implementation * pprinter * fix lexing bug * update testsuite * implement js-like application for expressions and classes * application syntax * make class type parameters optional * fix lexer locations * WIP parser * WIP parser * WIP parser * WIP tests * WIP parser * REMOVE ME quick test * fix parser error * reason_parser: fix es6_fun * add (not)pretty-printer * updates tests, FIXME There is a bug caught by bucklescript test: (preview##(style##border)#=args)(somenum); is formatted as preview##(style##border)#=args (somenum); which is then formatted as preview##(style##border)#=(args (somenum)); * fix SHARPOP precedence * less parenthesis * less parenthesis (2) * sweet pretty print for patterns * update tests * less parenthesis * add x => <expr> and {x,y} => <expr> syntax * less parenthesis * wip: lighter labelled arguments syntax * label punning for constrained expr/pattern * wip * WIP * multiple path application syntax * WIP * WIP: usable full grammar rework * REMOVE ME update reason-parser/test * test ambiguity in printing of "module type with" * implement and test module type extensions printing * prettier printing * update tests * put space after and not before : in type constraints * enable support simple_type => t * skip parentheses when printing simple_type => core_type * force ( or { around if/try/switch/while/for statements * update tests * simpler implementation of operator parsing * lexer: keep a \ in front * change operators prefix ! is now "not" postfix ^ is now dereferencing (instead of prefix !) infix ++ is now string concatenation (instead of infix ^) ^ now defines a family of postfix operators (^@, ^/, etc), that cannot terminates with ".". (How should existing ocaml operators be remapped?) * fix operators location * wip test update * make ! behave like unary -/+, fix printing ambiguities with ^ * make floating attributes disappear * print floating attributes * prepare item attributes disambiguation * WIP * WIP * WIP: finished using CPS for and_type_declaration * merge [@@ and [@: only [@ remains! We need to distinguish expressions that accept and reject attributes. The current code use `unattributed_expr_template` to generalize. The code can probably be cleaned up by adjusting precedence rules. * update printing and tests * fix type declarations location * fix unified attributes * WIP document * document some parser design decisions * more flexible attributes for value constructor declaration * WIP: DOCSTRINGS again * improve handling of attributes * fix * fix printing of item attributes on eval and extensions * update pprint for doc comments * Fix bad merge * More merge-related fixes * More fixes * Fix jsx tests * fix printing of doc attributes * toolchain: with ocaml parser, filter doc comments from comment list if they appear in the AST * Update tests * remove me * change syntax of polymorphic variants * reason_pprint_ast: fix printing of polymorphic variants payload type and module types inside functors types * reason_pprint_ast: fix printing of comments that could be confused with doc comments * wip update tests * fix printing of doc comments * fix printing of attributes on class * tests: mark some doc strings as floatings * fix build with other ocaml versions * Unsure * fix printing of (!) * update some test expectations * change array access syntax from a.(x) to a[x] * print array[index] * update tests * remove one level of parentheses in switch ((1, 2)) { ... }
2017-08-18 14:00:30 +02:00
let (<..>)(a,b) = a + b;
let five = 2 <..> 3;
type closedObjSugar = Js.t({. foo: bar, baz: int});
type openObjSugar = Js.t({.. x: int, y: int});
type x = Js.t({.});
type y = Js.t({..});
/* #1595: always break object rows (>= 2) for readability */
type o = {
.
a: int,
b: int
};
type o2 = {
..
a: int,
b: int
};