Skip to content

Commit 1bc1513

Browse files
committed
Rename @ns.ternary to @res.ternary.
1 parent 3138be6 commit 1bc1513

19 files changed

+79
-78
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49874,7 +49874,7 @@ let filterParsingAttrs attrs =
4987449874
| ( {
4987549875
Location.txt =
4987649876
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
49877-
| "res.optional" | "ns.ternary" | "res.async" | "res.await"
49877+
| "res.optional" | "res.ternary" | "res.async" | "res.await"
4987849878
| "res.template" );
4987949879
},
4988049880
_ ) ->
@@ -50022,7 +50022,7 @@ let hasAttributes attrs =
5002250022
match attr with
5002350023
| ( {
5002450024
Location.txt =
50025-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.ternary"
50025+
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
5002650026
| "res.async" | "res.await" | "res.template" );
5002750027
},
5002850028
_ ) ->
@@ -50091,7 +50091,7 @@ let collectIfExpressions expr =
5009150091
let rec hasTernaryAttribute attrs =
5009250092
match attrs with
5009350093
| [] -> false
50094-
| ({Location.txt = "ns.ternary"}, _) :: _ -> true
50094+
| ({Location.txt = "res.ternary"}, _) :: _ -> true
5009550095
| _ :: attrs -> hasTernaryAttribute attrs
5009650096

5009750097
let isTernaryExpr expr =
@@ -50125,7 +50125,7 @@ let filterTernaryAttributes attrs =
5012550125
List.filter
5012650126
(fun attr ->
5012750127
match attr with
50128-
| {Location.txt = "ns.ternary"}, _ -> false
50128+
| {Location.txt = "res.ternary"}, _ -> false
5012950129
| _ -> true)
5013050130
attrs
5013150131

@@ -50205,7 +50205,7 @@ let isPrintableAttribute attr =
5020550205
| ( {
5020650206
Location.txt =
5020750207
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
50208-
| "res.await" | "res.template" | "ns.ternary" );
50208+
| "res.await" | "res.template" | "res.ternary" );
5020950209
},
5021050210
_ ) ->
5021150211
false
@@ -55290,7 +55290,7 @@ and printValueBinding ~state ~recFlag (vb : Parsetree.value_binding) cmtTbl i =
5529055290
||
5529155291
match vb.pvb_expr with
5529255292
| {
55293-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
55293+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
5529455294
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
5529555295
} ->
5529655296
ParsetreeViewer.isBinaryExpression ifExpr
@@ -57127,7 +57127,7 @@ and printPexpApply ~state expr cmtTbl =
5712757127
||
5712857128
match targetExpr with
5712957129
| {
57130-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
57130+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
5713157131
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
5713257132
} ->
5713357133
ParsetreeViewer.isBinaryExpression ifExpr

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49874,7 +49874,7 @@ let filterParsingAttrs attrs =
4987449874
| ( {
4987549875
Location.txt =
4987649876
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
49877-
| "res.optional" | "ns.ternary" | "res.async" | "res.await"
49877+
| "res.optional" | "res.ternary" | "res.async" | "res.await"
4987849878
| "res.template" );
4987949879
},
4988049880
_ ) ->
@@ -50022,7 +50022,7 @@ let hasAttributes attrs =
5002250022
match attr with
5002350023
| ( {
5002450024
Location.txt =
50025-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.ternary"
50025+
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
5002650026
| "res.async" | "res.await" | "res.template" );
5002750027
},
5002850028
_ ) ->
@@ -50091,7 +50091,7 @@ let collectIfExpressions expr =
5009150091
let rec hasTernaryAttribute attrs =
5009250092
match attrs with
5009350093
| [] -> false
50094-
| ({Location.txt = "ns.ternary"}, _) :: _ -> true
50094+
| ({Location.txt = "res.ternary"}, _) :: _ -> true
5009550095
| _ :: attrs -> hasTernaryAttribute attrs
5009650096

5009750097
let isTernaryExpr expr =
@@ -50125,7 +50125,7 @@ let filterTernaryAttributes attrs =
5012550125
List.filter
5012650126
(fun attr ->
5012750127
match attr with
50128-
| {Location.txt = "ns.ternary"}, _ -> false
50128+
| {Location.txt = "res.ternary"}, _ -> false
5012950129
| _ -> true)
5013050130
attrs
5013150131

@@ -50205,7 +50205,7 @@ let isPrintableAttribute attr =
5020550205
| ( {
5020650206
Location.txt =
5020750207
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
50208-
| "res.await" | "res.template" | "ns.ternary" );
50208+
| "res.await" | "res.template" | "res.ternary" );
5020950209
},
5021050210
_ ) ->
5021150211
false
@@ -55290,7 +55290,7 @@ and printValueBinding ~state ~recFlag (vb : Parsetree.value_binding) cmtTbl i =
5529055290
||
5529155291
match vb.pvb_expr with
5529255292
| {
55293-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
55293+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
5529455294
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
5529555295
} ->
5529655296
ParsetreeViewer.isBinaryExpression ifExpr
@@ -57127,7 +57127,7 @@ and printPexpApply ~state expr cmtTbl =
5712757127
||
5712857128
match targetExpr with
5712957129
| {
57130-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
57130+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
5713157131
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
5713257132
} ->
5713357133
ParsetreeViewer.isBinaryExpression ifExpr
@@ -162141,7 +162141,7 @@ end
162141162141

162142162142
let jsxAttr = (Location.mknoloc "JSX", Parsetree.PStr [])
162143162143
let uncurriedAppAttr = (Location.mknoloc "res.uapp", Parsetree.PStr [])
162144-
let ternaryAttr = (Location.mknoloc "ns.ternary", Parsetree.PStr [])
162144+
let ternaryAttr = (Location.mknoloc "res.ternary", Parsetree.PStr [])
162145162145
let ifLetAttr = (Location.mknoloc "ns.iflet", Parsetree.PStr [])
162146162146
let optionalAttr = (Location.mknoloc "res.optional", Parsetree.PStr [])
162147162147
let makeAwaitAttr loc = (Location.mkloc "res.await" loc, Parsetree.PStr [])

lib/4.06.1/whole_compiler.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104868,7 +104868,7 @@ let filterParsingAttrs attrs =
104868104868
| ( {
104869104869
Location.txt =
104870104870
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
104871-
| "res.optional" | "ns.ternary" | "res.async" | "res.await"
104871+
| "res.optional" | "res.ternary" | "res.async" | "res.await"
104872104872
| "res.template" );
104873104873
},
104874104874
_ ) ->
@@ -105016,7 +105016,7 @@ let hasAttributes attrs =
105016105016
match attr with
105017105017
| ( {
105018105018
Location.txt =
105019-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.ternary"
105019+
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
105020105020
| "res.async" | "res.await" | "res.template" );
105021105021
},
105022105022
_ ) ->
@@ -105085,7 +105085,7 @@ let collectIfExpressions expr =
105085105085
let rec hasTernaryAttribute attrs =
105086105086
match attrs with
105087105087
| [] -> false
105088-
| ({Location.txt = "ns.ternary"}, _) :: _ -> true
105088+
| ({Location.txt = "res.ternary"}, _) :: _ -> true
105089105089
| _ :: attrs -> hasTernaryAttribute attrs
105090105090

105091105091
let isTernaryExpr expr =
@@ -105119,7 +105119,7 @@ let filterTernaryAttributes attrs =
105119105119
List.filter
105120105120
(fun attr ->
105121105121
match attr with
105122-
| {Location.txt = "ns.ternary"}, _ -> false
105122+
| {Location.txt = "res.ternary"}, _ -> false
105123105123
| _ -> true)
105124105124
attrs
105125105125

@@ -105199,7 +105199,7 @@ let isPrintableAttribute attr =
105199105199
| ( {
105200105200
Location.txt =
105201105201
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
105202-
| "res.await" | "res.template" | "ns.ternary" );
105202+
| "res.await" | "res.template" | "res.ternary" );
105203105203
},
105204105204
_ ) ->
105205105205
false
@@ -110284,7 +110284,7 @@ and printValueBinding ~state ~recFlag (vb : Parsetree.value_binding) cmtTbl i =
110284110284
||
110285110285
match vb.pvb_expr with
110286110286
| {
110287-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
110287+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
110288110288
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
110289110289
} ->
110290110290
ParsetreeViewer.isBinaryExpression ifExpr
@@ -112121,7 +112121,7 @@ and printPexpApply ~state expr cmtTbl =
112121112121
||
112122112122
match targetExpr with
112123112123
| {
112124-
pexp_attributes = [({Location.txt = "ns.ternary"}, _)];
112124+
pexp_attributes = [({Location.txt = "res.ternary"}, _)];
112125112125
pexp_desc = Pexp_ifthenelse (ifExpr, _, _);
112126112126
} ->
112127112127
ParsetreeViewer.isBinaryExpression ifExpr
@@ -175573,7 +175573,7 @@ end
175573175573

175574175574
let jsxAttr = (Location.mknoloc "JSX", Parsetree.PStr [])
175575175575
let uncurriedAppAttr = (Location.mknoloc "res.uapp", Parsetree.PStr [])
175576-
let ternaryAttr = (Location.mknoloc "ns.ternary", Parsetree.PStr [])
175576+
let ternaryAttr = (Location.mknoloc "res.ternary", Parsetree.PStr [])
175577175577
let ifLetAttr = (Location.mknoloc "ns.iflet", Parsetree.PStr [])
175578175578
let optionalAttr = (Location.mknoloc "res.optional", Parsetree.PStr [])
175579175579
let makeAwaitAttr loc = (Location.mkloc "res.await" loc, Parsetree.PStr [])
@@ -182732,7 +182732,7 @@ let normalize =
182732182732
};
182733182733
] ) ->
182734182734
let ternaryMarker =
182735-
(Location.mknoloc "ns.ternary", Parsetree.PStr [])
182735+
(Location.mknoloc "res.ternary", Parsetree.PStr [])
182736182736
in
182737182737
{
182738182738
Parsetree.pexp_loc = expr.pexp_loc;

res_syntax/benchmarks/data/Napkinscript.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,7 @@ end = struct
31973197
let filterParsingAttrs attrs =
31983198
List.filter (fun attr ->
31993199
match attr with
3200-
| ({Location.txt = ("ns.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc")}, _) -> false
3200+
| ({Location.txt = ("res.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc")}, _) -> false
32013201
| _ -> true
32023202
) attrs
32033203

@@ -3301,7 +3301,7 @@ end = struct
33013301

33023302
let hasAttributes attrs =
33033303
List.exists (fun attr -> match attr with
3304-
| ({Location.txt = "bs" | "ns.ternary" | "ns.braces"}, _) -> false
3304+
| ({Location.txt = "bs" | "res.ternary" | "ns.braces"}, _) -> false
33053305
| _ -> true
33063306
) attrs
33073307

@@ -3315,7 +3315,7 @@ end = struct
33153315
let rec hasTernaryAttribute attrs =
33163316
match attrs with
33173317
| [] -> false
3318-
| ({Location.txt="ns.ternary"},_)::_ -> true
3318+
| ({Location.txt="res.ternary"},_)::_ -> true
33193319
| _::attrs -> hasTernaryAttribute attrs
33203320

33213321
let isTernaryExpr expr = match expr with
@@ -3346,7 +3346,7 @@ end = struct
33463346

33473347
let filterTernaryAttributes attrs =
33483348
List.filter (fun attr -> match attr with
3349-
|({Location.txt="ns.ternary"},_) -> false
3349+
|({Location.txt="res.ternary"},_) -> false
33503350
| _ -> true
33513351
) attrs
33523352

@@ -3403,13 +3403,13 @@ end = struct
34033403

34043404
let filterPrinteableAttributes attrs =
34053405
List.filter (fun attr -> match attr with
3406-
| ({Location.txt="bs" | "ns.ternary"}, _) -> false
3406+
| ({Location.txt="bs" | "res.ternary"}, _) -> false
34073407
| _ -> true
34083408
) attrs
34093409

34103410
let partitionPrinteableAttributes attrs =
34113411
List.partition (fun attr -> match attr with
3412-
| ({Location.txt="bs" | "ns.ternary"}, _) -> false
3412+
| ({Location.txt="bs" | "res.ternary"}, _) -> false
34133413
| _ -> true
34143414
) attrs
34153415

@@ -7706,7 +7706,7 @@ module Printer = struct
77067706
ParsetreeViewer.isBinaryExpression expr ||
77077707
(match vb.pvb_expr with
77087708
| {
7709-
pexp_attributes = [({Location.txt="ns.ternary"}, _)];
7709+
pexp_attributes = [({Location.txt="res.ternary"}, _)];
77107710
pexp_desc = Pexp_ifthenelse (ifExpr, _, _)
77117711
} ->
77127712
ParsetreeViewer.isBinaryExpression ifExpr || ParsetreeViewer.hasAttributes ifExpr.pexp_attributes
@@ -9402,7 +9402,7 @@ module Printer = struct
94029402
ParsetreeViewer.isBinaryExpression targetExpr ||
94039403
(match targetExpr with
94049404
| {
9405-
pexp_attributes = [({Location.txt="ns.ternary"}, _)];
9405+
pexp_attributes = [({Location.txt="res.ternary"}, _)];
94069406
pexp_desc = Pexp_ifthenelse (ifExpr, _, _)
94079407
} ->
94089408
ParsetreeViewer.isBinaryExpression ifExpr || ParsetreeViewer.hasAttributes ifExpr.pexp_attributes
@@ -11991,7 +11991,7 @@ module ParsetreeCompatibility = struct
1199111991
{pc_lhs = {ppat_desc = Ppat_construct ({txt = Longident.Lident "false"}, None)}; pc_rhs = elseExpr };
1199211992
]
1199311993
) ->
11994-
let ternaryMarker = (Location.mknoloc "ns.ternary", Parsetree.PStr []) in
11994+
let ternaryMarker = (Location.mknoloc "res.ternary", Parsetree.PStr []) in
1199511995
Ast_helper.Exp.ifthenelse
1199611996
~loc:expr.pexp_loc
1199711997
~attrs:(ternaryMarker::expr.pexp_attributes)
@@ -12322,7 +12322,7 @@ end
1232212322

1232312323
let jsxAttr = (Location.mknoloc "JSX", Parsetree.PStr [])
1232412324
let uncurryAttr = (Location.mknoloc "bs", Parsetree.PStr [])
12325-
let ternaryAttr = (Location.mknoloc "ns.ternary", Parsetree.PStr [])
12325+
let ternaryAttr = (Location.mknoloc "res.ternary", Parsetree.PStr [])
1232612326
let makeBracesAttr loc = (Location.mkloc "ns.braces" loc, Parsetree.PStr [])
1232712327

1232812328
type typDefOrExt =

res_syntax/benchmarks/data/Napkinscript.res

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,7 @@ module ParsetreeViewer: {
31963196

31973197
let filterParsingAttrs = attrs => List.filter(attr =>
31983198
switch attr {
3199-
| ({Location.txt: "ns.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc"}, _) => false
3199+
| ({Location.txt: "res.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc"}, _) => false
32003200
| _ => true
32013201
}
32023202
, attrs)
@@ -3328,7 +3328,7 @@ module ParsetreeViewer: {
33283328

33293329
let hasAttributes = attrs => List.exists(attr =>
33303330
switch attr {
3331-
| ({Location.txt: "bs" | "ns.ternary" | "ns.braces"}, _) => false
3331+
| ({Location.txt: "bs" | "res.ternary" | "ns.braces"}, _) => false
33323332
| _ => true
33333333
}
33343334
, attrs)
@@ -3345,7 +3345,7 @@ module ParsetreeViewer: {
33453345
let rec hasTernaryAttribute = attrs =>
33463346
switch attrs {
33473347
| list{} => false
3348-
| list{({Location.txt: "ns.ternary"}, _), ..._} => true
3348+
| list{({Location.txt: "res.ternary"}, _), ..._} => true
33493349
| list{_, ...attrs} => hasTernaryAttribute(attrs)
33503350
}
33513351

@@ -3377,7 +3377,7 @@ module ParsetreeViewer: {
33773377

33783378
let filterTernaryAttributes = attrs => List.filter(attr =>
33793379
switch attr {
3380-
| ({Location.txt: "ns.ternary"}, _) => false
3380+
| ({Location.txt: "res.ternary"}, _) => false
33813381
| _ => true
33823382
}
33833383
, attrs)
@@ -3450,14 +3450,14 @@ module ParsetreeViewer: {
34503450

34513451
let filterPrinteableAttributes = attrs => List.filter(attr =>
34523452
switch attr {
3453-
| ({Location.txt: "bs" | "ns.ternary"}, _) => false
3453+
| ({Location.txt: "bs" | "res.ternary"}, _) => false
34543454
| _ => true
34553455
}
34563456
, attrs)
34573457

34583458
let partitionPrinteableAttributes = attrs => List.partition(attr =>
34593459
switch attr {
3460-
| ({Location.txt: "bs" | "ns.ternary"}, _) => false
3460+
| ({Location.txt: "bs" | "res.ternary"}, _) => false
34613461
| _ => true
34623462
}
34633463
, attrs)
@@ -7972,7 +7972,7 @@ module Printer = {
79727972
ParsetreeViewer.isBinaryExpression(expr) ||
79737973
switch vb.pvb_expr {
79747974
| {
7975-
pexp_attributes: list{({Location.txt: "ns.ternary"}, _)},
7975+
pexp_attributes: list{({Location.txt: "res.ternary"}, _)},
79767976
pexp_desc: Pexp_ifthenelse(ifExpr, _, _),
79777977
} =>
79787978
ParsetreeViewer.isBinaryExpression(ifExpr) ||
@@ -9689,7 +9689,7 @@ module Printer = {
96899689
ParsetreeViewer.isBinaryExpression(targetExpr) ||
96909690
switch targetExpr {
96919691
| {
9692-
pexp_attributes: list{({Location.txt: "ns.ternary"}, _)},
9692+
pexp_attributes: list{({Location.txt: "res.ternary"}, _)},
96939693
pexp_desc: Pexp_ifthenelse(ifExpr, _, _),
96949694
} =>
96959695
ParsetreeViewer.isBinaryExpression(ifExpr) ||
@@ -12422,7 +12422,7 @@ module ParsetreeCompatibility = {
1242212422
},
1242312423
},
1242412424
) =>
12425-
let ternaryMarker = (Location.mknoloc("ns.ternary"), Parsetree.PStr(list{}))
12425+
let ternaryMarker = (Location.mknoloc("res.ternary"), Parsetree.PStr(list{}))
1242612426
Ast_helper.Exp.ifthenelse(
1242712427
~loc=expr.pexp_loc,
1242812428
~attrs=list{ternaryMarker, ...expr.pexp_attributes},
@@ -12811,7 +12811,7 @@ Solution: directly use `concat`."
1281112811

1281212812
let jsxAttr = (Location.mknoloc("JSX"), Parsetree.PStr(list{}))
1281312813
let uncurryAttr = (Location.mknoloc("bs"), Parsetree.PStr(list{}))
12814-
let ternaryAttr = (Location.mknoloc("ns.ternary"), Parsetree.PStr(list{}))
12814+
let ternaryAttr = (Location.mknoloc("res.ternary"), Parsetree.PStr(list{}))
1281512815
let makeBracesAttr = loc => (Location.mkloc("ns.braces", loc), Parsetree.PStr(list{}))
1281612816

1281712817
type typDefOrExt =

0 commit comments

Comments
 (0)