Skip to content

Commit 02331f3

Browse files
committed
Remove pipe last (|>) syntax
1 parent 53aa85d commit 02331f3

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

compiler/syntax/src/res_core.ml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,25 +2186,9 @@ and parse_binary_expr ?(context = OrdinaryExpr) ?a p prec =
21862186
let b = parse_binary_expr ~context p token_prec in
21872187
let loc = mk_loc a.Parsetree.pexp_loc.loc_start b.pexp_loc.loc_end in
21882188
let expr =
2189-
match (token, b.pexp_desc) with
2190-
| ( BarGreater,
2191-
Pexp_apply {funct = fun_expr; args; partial; transformed_jsx} ) ->
2192-
{
2193-
b with
2194-
pexp_desc =
2195-
Pexp_apply
2196-
{
2197-
funct = fun_expr;
2198-
args = args @ [(Nolabel, a)];
2199-
partial;
2200-
transformed_jsx;
2201-
};
2202-
}
2203-
| BarGreater, _ -> Ast_helper.Exp.apply ~loc b [(Nolabel, a)]
2204-
| _ ->
2205-
Ast_helper.Exp.apply ~loc
2206-
(make_infix_operator p token start_pos end_pos)
2207-
[(Nolabel, a); (Nolabel, b)]
2189+
Ast_helper.Exp.apply ~loc
2190+
(make_infix_operator p token start_pos end_pos)
2191+
[(Nolabel, a); (Nolabel, b)]
22082192
in
22092193
Parser.eat_breadcrumb p;
22102194
loop expr)

compiler/syntax/src/res_scanner.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,6 @@ let rec scan scanner =
820820
| '|' ->
821821
next2 scanner;
822822
Token.Lor
823-
| '>' ->
824-
next2 scanner;
825-
Token.BarGreater
826823
| _ ->
827824
next scanner;
828825
Token.Bar)

compiler/syntax/src/res_token.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ type t =
9494
| TemplateTail of string * Lexing.position
9595
| TemplatePart of string * Lexing.position
9696
| Backtick
97-
| BarGreater
9897
| Try
9998
| DocComment of Location.t * string
10099
| ModuleComment of Location.t * string
@@ -109,7 +108,7 @@ let precedence = function
109108
| Caret -> 4
110109
| Band -> 5
111110
| Equal | EqualEqual | EqualEqualEqual | LessThan | GreaterThan | BangEqual
112-
| BangEqualEqual | LessEqual | GreaterEqual | BarGreater ->
111+
| BangEqualEqual | LessEqual | GreaterEqual ->
113112
6
114113
| LeftShift | RightShift | RightShiftUnsigned -> 7
115114
| Plus | PlusDot | Minus | MinusDot | PlusPlus -> 8
@@ -213,7 +212,6 @@ let to_string = function
213212
| TemplatePart (text, _) -> text ^ "${"
214213
| TemplateTail (text, _) -> "TemplateTail(" ^ text ^ ")"
215214
| Backtick -> "`"
216-
| BarGreater -> "|>"
217215
| Try -> "try"
218216
| DocComment (_loc, s) -> "DocComment " ^ s
219217
| ModuleComment (_loc, s) -> "ModuleComment " ^ s

0 commit comments

Comments
 (0)