@@ -386,7 +386,7 @@ let buildLongident words =
386
386
let makeInfixOperator (p : Parser.t ) token startPos endPos =
387
387
let stringifiedToken =
388
388
if token = Token. MinusGreater then
389
- if p.uncurried_config |> Res_uncurried. isSwap then " |.u " else " |."
389
+ if p.uncurried_config = Legacy then " |." else " |.u "
390
390
else if token = Token. PlusPlus then " ^"
391
391
else if token = Token. BangEqual then " <>"
392
392
else if token = Token. BangEqualEqual then " !="
@@ -1558,8 +1558,7 @@ and parseEs6ArrowExpression ?(arrowAttrs = []) ?(arrowStartPos = None) ?context
1558
1558
| TermParameter {dotted} :: _
1559
1559
when p.uncurried_config |> Res_uncurried. fromDotted ~dotted && isFun ->
1560
1560
true
1561
- | TermParameter _ :: rest
1562
- when (not (p.uncurried_config |> Res_uncurried. isSwap)) && isFun ->
1561
+ | TermParameter _ :: rest when p.uncurried_config = Legacy && isFun ->
1563
1562
rest
1564
1563
|> List. exists (function
1565
1564
| TermParameter {dotted} -> dotted
@@ -1594,11 +1593,7 @@ and parseEs6ArrowExpression ?(arrowAttrs = []) ?(arrowStartPos = None) ?context
1594
1593
let uncurried =
1595
1594
p.uncurried_config |> Res_uncurried. fromDotted ~dotted
1596
1595
in
1597
- if
1598
- uncurried
1599
- && (termParamNum = 1
1600
- || not (p.uncurried_config |> Res_uncurried. isSwap))
1601
- then
1596
+ if uncurried && (termParamNum = 1 || p.uncurried_config = Legacy ) then
1602
1597
(termParamNum - 1 , Ast_uncurried. uncurriedFun ~loc ~arity funExpr, 1 )
1603
1598
else (termParamNum - 1 , funExpr, arity + 1 )
1604
1599
| TypeParameter {dotted = _ ; attrs; locs = newtypes ; pos = startPos } ->
@@ -3922,9 +3917,8 @@ and parsePolyTypeExpr p =
3922
3917
let returnType = parseTypExpr ~alias: false p in
3923
3918
let loc = mkLoc typ.Parsetree. ptyp_loc.loc_start p.prevEndPos in
3924
3919
let tFun = Ast_helper.Typ. arrow ~loc Asttypes. Nolabel typ returnType in
3925
- if p.uncurried_config |> Res_uncurried. isSwap then
3926
- Ast_uncurried. uncurriedType ~loc ~arity: 1 tFun
3927
- else tFun
3920
+ if p.uncurried_config = Legacy then tFun
3921
+ else Ast_uncurried. uncurriedType ~loc ~arity: 1 tFun
3928
3922
| _ -> Ast_helper.Typ. var ~loc: var.loc var.txt)
3929
3923
| _ -> assert false )
3930
3924
| _ -> parseTypExpr p
@@ -4252,7 +4246,7 @@ and parseEs6ArrowType ~attrs p =
4252
4246
let endPos = p.prevEndPos in
4253
4247
let returnTypeArity =
4254
4248
match parameters with
4255
- | _ when p.uncurried_config |> Res_uncurried. isSwap -> 0
4249
+ | _ when p.uncurried_config <> Legacy -> 0
4256
4250
| _ ->
4257
4251
if parameters |> List. exists (function {dotted; typ = _ } -> dotted)
4258
4252
then 0
@@ -4266,10 +4260,7 @@ and parseEs6ArrowType ~attrs p =
4266
4260
let uncurried =
4267
4261
p.uncurried_config |> Res_uncurried. fromDotted ~dotted
4268
4262
in
4269
- if
4270
- uncurried
4271
- && (paramNum = 1 || not (p.uncurried_config |> Res_uncurried. isSwap))
4272
- then
4263
+ if uncurried && (paramNum = 1 || p.uncurried_config = Legacy ) then
4273
4264
let loc = mkLoc startPos endPos in
4274
4265
let tArg = Ast_helper.Typ. arrow ~loc ~attrs argLbl typ t in
4275
4266
(paramNum - 1 , Ast_uncurried. uncurriedType ~loc ~arity tArg, 1 )
@@ -4334,9 +4325,8 @@ and parseArrowTypeRest ~es6Arrow ~startPos typ p =
4334
4325
let returnType = parseTypExpr ~alias: false p in
4335
4326
let loc = mkLoc startPos p.prevEndPos in
4336
4327
let arrowTyp = Ast_helper.Typ. arrow ~loc Asttypes. Nolabel typ returnType in
4337
- if p.uncurried_config |> Res_uncurried. isSwap then
4338
- Ast_uncurried. uncurriedType ~loc ~arity: 1 arrowTyp
4339
- else arrowTyp
4328
+ if p.uncurried_config = Legacy then arrowTyp
4329
+ else Ast_uncurried. uncurriedType ~loc ~arity: 1 arrowTyp
4340
4330
| _ -> typ
4341
4331
4342
4332
and parseTypExprRegion p =
0 commit comments