Skip to content

Commit 1a580bb

Browse files
committed
Rename ns.braces to res.braces
1 parent 1bc1513 commit 1a580bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+223
-219
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49863,7 +49863,7 @@ let funExpr expr =
4986349863

4986449864
let processBracesAttr expr =
4986549865
match expr.pexp_attributes with
49866-
| (({txt = "ns.braces"}, _) as attr) :: attrs ->
49866+
| (({txt = "res.braces"}, _) as attr) :: attrs ->
4986749867
(Some attr, {expr with pexp_attributes = attrs})
4986849868
| _ -> (None, expr)
4986949869

@@ -49873,7 +49873,7 @@ let filterParsingAttrs attrs =
4987349873
match attr with
4987449874
| ( {
4987549875
Location.txt =
49876-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
49876+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "ns.namedArgLoc"
4987749877
| "res.optional" | "res.ternary" | "res.async" | "res.await"
4987849878
| "res.template" );
4987949879
},
@@ -50022,7 +50022,7 @@ let hasAttributes attrs =
5002250022
match attr with
5002350023
| ( {
5002450024
Location.txt =
50025-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
50025+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "res.ternary"
5002650026
| "res.async" | "res.await" | "res.template" );
5002750027
},
5002850028
_ ) ->
@@ -50204,7 +50204,7 @@ let isPrintableAttribute attr =
5020450204
match attr with
5020550205
| ( {
5020650206
Location.txt =
50207-
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
50207+
( "bs" | "res.uapp" | "ns.iflet" | "res.braces" | "JSX" | "res.async"
5020850208
| "res.await" | "res.template" | "res.ternary" );
5020950209
},
5021050210
_ ) ->
@@ -50728,7 +50728,7 @@ let getLoc node =
5072850728
| _ -> expr.pexp_loc)
5072950729
| Expression e -> (
5073050730
match e.pexp_attributes with
50731-
| ({txt = "ns.braces"; loc}, _) :: _ -> loc
50731+
| ({txt = "res.braces"; loc}, _) :: _ -> loc
5073250732
| _ -> e.pexp_loc)
5073350733
| ExprRecordRow (li, e) -> {li.loc with loc_end = e.pexp_loc.loc_end}
5073450734
| ExtensionConstructor ec -> ec.pext_loc
@@ -56506,7 +56506,7 @@ and printExpression ~state (e : Parsetree.expression) cmtTbl =
5650656506
pexp_attributes =
5650756507
List.filter
5650856508
(function
56509-
| {Location.txt = "ns.braces"}, _ -> false
56509+
| {Location.txt = "res.braces"}, _ -> false
5651056510
| _ -> true)
5651156511
e.pexp_attributes;
5651256512
}

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49863,7 +49863,7 @@ let funExpr expr =
4986349863

4986449864
let processBracesAttr expr =
4986549865
match expr.pexp_attributes with
49866-
| (({txt = "ns.braces"}, _) as attr) :: attrs ->
49866+
| (({txt = "res.braces"}, _) as attr) :: attrs ->
4986749867
(Some attr, {expr with pexp_attributes = attrs})
4986849868
| _ -> (None, expr)
4986949869

@@ -49873,7 +49873,7 @@ let filterParsingAttrs attrs =
4987349873
match attr with
4987449874
| ( {
4987549875
Location.txt =
49876-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
49876+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "ns.namedArgLoc"
4987749877
| "res.optional" | "res.ternary" | "res.async" | "res.await"
4987849878
| "res.template" );
4987949879
},
@@ -50022,7 +50022,7 @@ let hasAttributes attrs =
5002250022
match attr with
5002350023
| ( {
5002450024
Location.txt =
50025-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
50025+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "res.ternary"
5002650026
| "res.async" | "res.await" | "res.template" );
5002750027
},
5002850028
_ ) ->
@@ -50204,7 +50204,7 @@ let isPrintableAttribute attr =
5020450204
match attr with
5020550205
| ( {
5020650206
Location.txt =
50207-
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
50207+
( "bs" | "res.uapp" | "ns.iflet" | "res.braces" | "JSX" | "res.async"
5020850208
| "res.await" | "res.template" | "res.ternary" );
5020950209
},
5021050210
_ ) ->
@@ -50728,7 +50728,7 @@ let getLoc node =
5072850728
| _ -> expr.pexp_loc)
5072950729
| Expression e -> (
5073050730
match e.pexp_attributes with
50731-
| ({txt = "ns.braces"; loc}, _) :: _ -> loc
50731+
| ({txt = "res.braces"; loc}, _) :: _ -> loc
5073250732
| _ -> e.pexp_loc)
5073350733
| ExprRecordRow (li, e) -> {li.loc with loc_end = e.pexp_loc.loc_end}
5073450734
| ExtensionConstructor ec -> ec.pext_loc
@@ -56506,7 +56506,7 @@ and printExpression ~state (e : Parsetree.expression) cmtTbl =
5650656506
pexp_attributes =
5650756507
List.filter
5650856508
(function
56509-
| {Location.txt = "ns.braces"}, _ -> false
56509+
| {Location.txt = "res.braces"}, _ -> false
5651056510
| _ -> true)
5651156511
e.pexp_attributes;
5651256512
}
@@ -162161,7 +162161,7 @@ let suppressFragileMatchWarningAttr =
162161162161
Ast_helper.Str.eval
162162162162
(Ast_helper.Exp.constant (Pconst_string ("-4", None)));
162163162163
] )
162164-
let makeBracesAttr loc = (Location.mkloc "ns.braces" loc, Parsetree.PStr [])
162164+
let makeBracesAttr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr [])
162165162165
let templateLiteralAttr = (Location.mknoloc "res.template", Parsetree.PStr [])
162166162166

162167162167
let spreadAttr = (Location.mknoloc "res.spread", Parsetree.PStr [])

lib/4.06.1/whole_compiler.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104857,7 +104857,7 @@ let funExpr expr =
104857104857

104858104858
let processBracesAttr expr =
104859104859
match expr.pexp_attributes with
104860-
| (({txt = "ns.braces"}, _) as attr) :: attrs ->
104860+
| (({txt = "res.braces"}, _) as attr) :: attrs ->
104861104861
(Some attr, {expr with pexp_attributes = attrs})
104862104862
| _ -> (None, expr)
104863104863

@@ -104867,7 +104867,7 @@ let filterParsingAttrs attrs =
104867104867
match attr with
104868104868
| ( {
104869104869
Location.txt =
104870-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
104870+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "ns.namedArgLoc"
104871104871
| "res.optional" | "res.ternary" | "res.async" | "res.await"
104872104872
| "res.template" );
104873104873
},
@@ -105016,7 +105016,7 @@ let hasAttributes attrs =
105016105016
match attr with
105017105017
| ( {
105018105018
Location.txt =
105019-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
105019+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "res.ternary"
105020105020
| "res.async" | "res.await" | "res.template" );
105021105021
},
105022105022
_ ) ->
@@ -105198,7 +105198,7 @@ let isPrintableAttribute attr =
105198105198
match attr with
105199105199
| ( {
105200105200
Location.txt =
105201-
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
105201+
( "bs" | "res.uapp" | "ns.iflet" | "res.braces" | "JSX" | "res.async"
105202105202
| "res.await" | "res.template" | "res.ternary" );
105203105203
},
105204105204
_ ) ->
@@ -105722,7 +105722,7 @@ let getLoc node =
105722105722
| _ -> expr.pexp_loc)
105723105723
| Expression e -> (
105724105724
match e.pexp_attributes with
105725-
| ({txt = "ns.braces"; loc}, _) :: _ -> loc
105725+
| ({txt = "res.braces"; loc}, _) :: _ -> loc
105726105726
| _ -> e.pexp_loc)
105727105727
| ExprRecordRow (li, e) -> {li.loc with loc_end = e.pexp_loc.loc_end}
105728105728
| ExtensionConstructor ec -> ec.pext_loc
@@ -111500,7 +111500,7 @@ and printExpression ~state (e : Parsetree.expression) cmtTbl =
111500111500
pexp_attributes =
111501111501
List.filter
111502111502
(function
111503-
| {Location.txt = "ns.braces"}, _ -> false
111503+
| {Location.txt = "res.braces"}, _ -> false
111504111504
| _ -> true)
111505111505
e.pexp_attributes;
111506111506
}
@@ -175593,7 +175593,7 @@ let suppressFragileMatchWarningAttr =
175593175593
Ast_helper.Str.eval
175594175594
(Ast_helper.Exp.constant (Pconst_string ("-4", None)));
175595175595
] )
175596-
let makeBracesAttr loc = (Location.mkloc "ns.braces" loc, Parsetree.PStr [])
175596+
let makeBracesAttr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr [])
175597175597
let templateLiteralAttr = (Location.mknoloc "res.template", Parsetree.PStr [])
175598175598

175599175599
let spreadAttr = (Location.mknoloc "res.spread", Parsetree.PStr [])

res_syntax/benchmarks/data/Napkinscript.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,15 +3189,15 @@ end = struct
31893189

31903190
let processBracesAttr expr =
31913191
match expr.pexp_attributes with
3192-
| (({txt = "ns.braces"}, _) as attr)::attrs ->
3192+
| (({txt = "res.braces"}, _) as attr)::attrs ->
31933193
(Some attr, {expr with pexp_attributes = attrs})
31943194
| _ ->
31953195
(None, expr)
31963196

31973197
let filterParsingAttrs attrs =
31983198
List.filter (fun attr ->
31993199
match attr with
3200-
| ({Location.txt = ("res.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc")}, _) -> false
3200+
| ({Location.txt = ("res.ternary" | "res.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" | "res.ternary" | "ns.braces"}, _) -> false
3304+
| ({Location.txt = "bs" | "res.ternary" | "res.braces"}, _) -> false
33053305
| _ -> true
33063306
) attrs
33073307

@@ -9250,7 +9250,7 @@ module Printer = struct
92509250
match Parens.binaryExpr {expr with
92519251
pexp_attributes = List.filter (fun attr ->
92529252
match attr with
9253-
| ({Location.txt = ("ns.braces")}, _) -> false
9253+
| ({Location.txt = ("res.braces")}, _) -> false
92549254
| _ -> true
92559255
) expr.pexp_attributes
92569256
} with
@@ -12323,7 +12323,7 @@ end
1232312323
let jsxAttr = (Location.mknoloc "JSX", Parsetree.PStr [])
1232412324
let uncurryAttr = (Location.mknoloc "bs", Parsetree.PStr [])
1232512325
let ternaryAttr = (Location.mknoloc "res.ternary", Parsetree.PStr [])
12326-
let makeBracesAttr loc = (Location.mkloc "ns.braces" loc, Parsetree.PStr [])
12326+
let makeBracesAttr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr [])
1232712327

1232812328
type typDefOrExt =
1232912329
| TypeDef of {recFlag: Asttypes.rec_flag; types: Parsetree.type_declaration list}

res_syntax/benchmarks/data/Napkinscript.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,7 @@ module ParsetreeViewer: {
31873187

31883188
let processBracesAttr = expr =>
31893189
switch expr.pexp_attributes {
3190-
| list{({txt: "ns.braces"}, _) as attr, ...attrs} => (
3190+
| list{({txt: "res.braces"}, _) as attr, ...attrs} => (
31913191
Some(attr),
31923192
{...expr, pexp_attributes: attrs},
31933193
)
@@ -3196,7 +3196,7 @@ module ParsetreeViewer: {
31963196

31973197
let filterParsingAttrs = attrs => List.filter(attr =>
31983198
switch attr {
3199-
| ({Location.txt: "res.ternary" | "ns.braces" | "bs" | "ns.namedArgLoc"}, _) => false
3199+
| ({Location.txt: "res.ternary" | "res.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" | "res.ternary" | "ns.braces"}, _) => false
3331+
| ({Location.txt: "bs" | "res.ternary" | "res.braces"}, _) => false
33323332
| _ => true
33333333
}
33343334
, attrs)
@@ -9532,7 +9532,7 @@ module Printer = {
95329532
...expr,
95339533
pexp_attributes: List.filter(attr =>
95349534
switch attr {
9535-
| ({Location.txt: "ns.braces"}, _) => false
9535+
| ({Location.txt: "res.braces"}, _) => false
95369536
| _ => true
95379537
}
95389538
, expr.pexp_attributes),
@@ -12812,7 +12812,7 @@ Solution: directly use `concat`."
1281212812
let jsxAttr = (Location.mknoloc("JSX"), Parsetree.PStr(list{}))
1281312813
let uncurryAttr = (Location.mknoloc("bs"), Parsetree.PStr(list{}))
1281412814
let ternaryAttr = (Location.mknoloc("res.ternary"), Parsetree.PStr(list{}))
12815-
let makeBracesAttr = loc => (Location.mkloc("ns.braces", loc), Parsetree.PStr(list{}))
12815+
let makeBracesAttr = loc => (Location.mkloc("res.braces", loc), Parsetree.PStr(list{}))
1281612816

1281712817
type typDefOrExt =
1281812818
| TypeDef({recFlag: Asttypes.rec_flag, types: list<Parsetree.type_declaration>})

res_syntax/src/res_comments_table.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ let getLoc node =
354354
| _ -> expr.pexp_loc)
355355
| Expression e -> (
356356
match e.pexp_attributes with
357-
| ({txt = "ns.braces"; loc}, _) :: _ -> loc
357+
| ({txt = "res.braces"; loc}, _) :: _ -> loc
358358
| _ -> e.pexp_loc)
359359
| ExprRecordRow (li, e) -> {li.loc with loc_end = e.pexp_loc.loc_end}
360360
| ExtensionConstructor ec -> ec.pext_loc

res_syntax/src/res_core.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ let suppressFragileMatchWarningAttr =
169169
Ast_helper.Str.eval
170170
(Ast_helper.Exp.constant (Pconst_string ("-4", None)));
171171
] )
172-
let makeBracesAttr loc = (Location.mkloc "ns.braces" loc, Parsetree.PStr [])
172+
let makeBracesAttr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr [])
173173
let templateLiteralAttr = (Location.mknoloc "res.template", Parsetree.PStr [])
174174

175175
let spreadAttr = (Location.mknoloc "res.spread", Parsetree.PStr [])

res_syntax/src/res_parsetree_viewer.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ let funExpr expr =
198198

199199
let processBracesAttr expr =
200200
match expr.pexp_attributes with
201-
| (({txt = "ns.braces"}, _) as attr) :: attrs ->
201+
| (({txt = "res.braces"}, _) as attr) :: attrs ->
202202
(Some attr, {expr with pexp_attributes = attrs})
203203
| _ -> (None, expr)
204204

@@ -208,7 +208,7 @@ let filterParsingAttrs attrs =
208208
match attr with
209209
| ( {
210210
Location.txt =
211-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "ns.namedArgLoc"
211+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "ns.namedArgLoc"
212212
| "res.optional" | "res.ternary" | "res.async" | "res.await"
213213
| "res.template" );
214214
},
@@ -357,7 +357,7 @@ let hasAttributes attrs =
357357
match attr with
358358
| ( {
359359
Location.txt =
360-
( "bs" | "res.uapp" | "ns.braces" | "ns.iflet" | "res.ternary"
360+
( "bs" | "res.uapp" | "res.braces" | "ns.iflet" | "res.ternary"
361361
| "res.async" | "res.await" | "res.template" );
362362
},
363363
_ ) ->
@@ -539,7 +539,7 @@ let isPrintableAttribute attr =
539539
match attr with
540540
| ( {
541541
Location.txt =
542-
( "bs" | "res.uapp" | "ns.iflet" | "ns.braces" | "JSX" | "res.async"
542+
( "bs" | "res.uapp" | "ns.iflet" | "res.braces" | "JSX" | "res.async"
543543
| "res.await" | "res.template" | "res.ternary" );
544544
},
545545
_ ) ->

res_syntax/src/res_printer.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3284,7 +3284,7 @@ and printExpression ~state (e : Parsetree.expression) cmtTbl =
32843284
pexp_attributes =
32853285
List.filter
32863286
(function
3287-
| {Location.txt = "ns.braces"}, _ -> false
3287+
| {Location.txt = "res.braces"}, _ -> false
32883288
| _ -> true)
32893289
e.pexp_attributes;
32903290
}

res_syntax/tests/parsing/errors/expressions/expected/ambiguousArrow.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626

2727
let a b = ({js|hi|js} : int)
2828
let x = ((let a = 1 in let b = 2 in fun pattern -> ({js|test|js} : int))
29-
[@ns.braces ])
29+
[@res.braces ])

res_syntax/tests/parsing/errors/expressions/expected/arrow.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
;;(Object.keys providers).reduce
1212
(fun elements ->
13-
fun providerId -> ((let x = 1 in let b = 2 in x + b)[@ns.braces ]))
13+
fun providerId -> ((let x = 1 in let b = 2 in x + b)[@res.braces ]))

res_syntax/tests/parsing/errors/expressions/expected/block.res.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ let findThreadByIdLinearScan ~threads:((threads)[@ns.namedArgLoc ])
7676
| Unknown { id } ->
7777
(unknown.id |. Js.String.make) |. FBID.ofStringUnsafe in
7878
thisId == id)
79-
[@ns.braces ])))
80-
[@ns.braces ])
81-
let x = ((loop 0 (Nil |. (push doc)))[@ns.braces ])
79+
[@res.braces ])))
80+
[@res.braces ])
81+
let x = ((loop 0 (Nil |. (push doc)))[@res.braces ])
8282
;;match stack with
8383
| Empty -> [%rescript.exprhole ]
8484
| Cons (doc, rest) -> ()

res_syntax/tests/parsing/errors/expressions/expected/consecutive.res.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646

4747
let f a b = a + 3
4848
;;b
49-
let f g h = ((a + 3; b)[@ns.braces ])
50-
let () = ((sideEffect1 (); sideEffect2 ())[@ns.braces ])
51-
let () = ((let open Foo in let exception End in x ())[@ns.braces ])
49+
let f g h = ((a + 3; b)[@res.braces ])
50+
let () = ((sideEffect1 (); sideEffect2 ())[@res.braces ])
51+
let () = ((let open Foo in let exception End in x ())[@res.braces ])

res_syntax/tests/parsing/errors/expressions/expected/implementation.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
module InstallerDownload =
1414
struct
15-
let make () = ((div ~children:[] ())[@ns.braces ][@JSX ])[@@react.component
16-
]
15+
let make () = ((div ~children:[] ())[@res.braces ][@JSX ])[@@react.component
16+
]
1717
end
1818
module LicenseList = struct end

res_syntax/tests/parsing/errors/expressions/expected/letBinding.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ let foo = 2.
8383
let foo = true
8484
let foo = 2
8585
let foo = f ()
86-
let foo = ((2)[@ns.braces ])
87-
let foo = (({js|foo|js})[@ns.braces ])
86+
let foo = ((2)[@res.braces ])
87+
let foo = (({js|foo|js})[@res.braces ])
8888
let foo as x = ()

0 commit comments

Comments
 (0)