diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml
index a49ed5ae38a..63ca3a29582 100644
--- a/lib/4.06.1/unstable/js_compiler.ml
+++ b/lib/4.06.1/unstable/js_compiler.ml
@@ -49873,9 +49873,9 @@ let filterParsingAttrs attrs =
match attr with
| ( {
Location.txt =
- ( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
- | "res.optional" | "res.ternary" | "res.async" | "res.await"
- | "res.template" );
+ ( "bs" | "res.uapp" | "res.braces" | "res.iflet"
+ | "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
+ | "res.await" | "res.template" );
},
_ ) ->
false
@@ -50723,7 +50723,7 @@ let getLoc node =
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc)
| Expression e -> (
@@ -51731,7 +51731,7 @@ and walkExpression expr t comments =
let open Parsetree in
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
@@ -51790,7 +51790,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
and walkExprArgument expr t comments =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
let leading, trailing = partitionLeadingTrailing comments loc in
attach t.leading loc leading;
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -52198,7 +52198,7 @@ and walkTypeParameters typeParameters t comments =
visitListButContinueWithRemainingComments
~getLoc:(fun (_, _, typexpr) ->
match typexpr.Parsetree.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = typexpr.ptyp_loc.loc_end}
| _ -> typexpr.ptyp_loc)
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
@@ -55147,7 +55147,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
in
let loc, typ =
match typ.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
( {loc with loc_end = typ.ptyp_loc.loc_end},
{typ with ptyp_attributes = attrs} )
| _ -> (typ.ptyp_loc, typ)
@@ -57433,7 +57433,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
] ->
let loc =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc
in
@@ -57469,7 +57469,7 @@ and printJsxProp ~state arg cmtTbl =
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
{
Parsetree.pexp_attributes =
- [({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
+ [({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
} )
when lblTxt = ident (* jsx punning *) -> (
@@ -57495,7 +57495,7 @@ and printJsxProp ~state arg cmtTbl =
| lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (Location.none, expr)
in
@@ -57792,12 +57792,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Labelled lbl,
({
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} as argExpr) )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -57811,12 +57811,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
typ );
pexp_loc;
pexp_attributes =
- ([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
+ ([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
} )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match attrs with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pexp_loc.loc_end}
| _ -> arg.pexp_loc
in
@@ -57834,12 +57834,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Optional lbl,
{
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} )
when lbl = name ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
@@ -57847,7 +57847,7 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| _lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (expr.pexp_loc, expr)
in
@@ -58137,13 +58137,13 @@ and printExpFunParameter ~state parameter cmtTbl =
match defaultExpr with
| None -> (
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pattern.ppat_loc.loc_end}
| _ -> pattern.ppat_loc)
| Some expr ->
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
{
diff --git a/lib/4.06.1/unstable/js_playground_compiler.ml b/lib/4.06.1/unstable/js_playground_compiler.ml
index f304add376d..7c0145367c0 100644
--- a/lib/4.06.1/unstable/js_playground_compiler.ml
+++ b/lib/4.06.1/unstable/js_playground_compiler.ml
@@ -49873,9 +49873,9 @@ let filterParsingAttrs attrs =
match attr with
| ( {
Location.txt =
- ( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
- | "res.optional" | "res.ternary" | "res.async" | "res.await"
- | "res.template" );
+ ( "bs" | "res.uapp" | "res.braces" | "res.iflet"
+ | "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
+ | "res.await" | "res.template" );
},
_ ) ->
false
@@ -50723,7 +50723,7 @@ let getLoc node =
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc)
| Expression e -> (
@@ -51731,7 +51731,7 @@ and walkExpression expr t comments =
let open Parsetree in
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
@@ -51790,7 +51790,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
and walkExprArgument expr t comments =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
let leading, trailing = partitionLeadingTrailing comments loc in
attach t.leading loc leading;
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -52198,7 +52198,7 @@ and walkTypeParameters typeParameters t comments =
visitListButContinueWithRemainingComments
~getLoc:(fun (_, _, typexpr) ->
match typexpr.Parsetree.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = typexpr.ptyp_loc.loc_end}
| _ -> typexpr.ptyp_loc)
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
@@ -55147,7 +55147,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
in
let loc, typ =
match typ.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
( {loc with loc_end = typ.ptyp_loc.loc_end},
{typ with ptyp_attributes = attrs} )
| _ -> (typ.ptyp_loc, typ)
@@ -57433,7 +57433,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
] ->
let loc =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc
in
@@ -57469,7 +57469,7 @@ and printJsxProp ~state arg cmtTbl =
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
{
Parsetree.pexp_attributes =
- [({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
+ [({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
} )
when lblTxt = ident (* jsx punning *) -> (
@@ -57495,7 +57495,7 @@ and printJsxProp ~state arg cmtTbl =
| lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (Location.none, expr)
in
@@ -57792,12 +57792,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Labelled lbl,
({
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} as argExpr) )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -57811,12 +57811,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
typ );
pexp_loc;
pexp_attributes =
- ([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
+ ([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
} )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match attrs with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pexp_loc.loc_end}
| _ -> arg.pexp_loc
in
@@ -57834,12 +57834,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Optional lbl,
{
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} )
when lbl = name ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
@@ -57847,7 +57847,7 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| _lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (expr.pexp_loc, expr)
in
@@ -58137,13 +58137,13 @@ and printExpFunParameter ~state parameter cmtTbl =
match defaultExpr with
| None -> (
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pattern.ppat_loc.loc_end}
| _ -> pattern.ppat_loc)
| Some expr ->
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
{
@@ -163640,7 +163640,7 @@ and parseParameter p =
Parser.next p;
let lblName, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
match p.Parser.token with
| Comma | Equal | Rparen ->
@@ -164674,7 +164674,7 @@ and parseJsxProp p =
let optional = Parser.optional p Question in
let name, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
(* optional punning: *)
if optional then
@@ -164713,7 +164713,7 @@ and parseJsxProp p =
Parser.next p;
let loc = mkLoc p.Parser.startPos p.prevEndPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let attrExpr =
let e = parsePrimaryExpr ~operand:(parseAtomicExpr p) p in
@@ -165530,7 +165530,7 @@ and parseArgument2 p ~dotted : argument option =
let endPos = p.prevEndPos in
let loc = mkLoc startPos endPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let identExpr =
Ast_helper.Exp.ident ~attrs:[propLocAttr] ~loc
@@ -166135,7 +166135,7 @@ and parseTypeParameter p =
Parser.next p;
let name, loc = parseLident p in
let lblLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
@@ -166213,7 +166213,9 @@ and parseEs6ArrowType ~attrs p =
| Tilde ->
Parser.next p;
let name, loc = parseLident p in
- let lblLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let lblLocAttr =
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
+ in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
let typ = parseTypExpr ~alias:false ~es6Arrow:false p in
diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml
index b3e62dd1c54..19438256099 100644
--- a/lib/4.06.1/whole_compiler.ml
+++ b/lib/4.06.1/whole_compiler.ml
@@ -104867,9 +104867,9 @@ let filterParsingAttrs attrs =
match attr with
| ( {
Location.txt =
- ( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
- | "res.optional" | "res.ternary" | "res.async" | "res.await"
- | "res.template" );
+ ( "bs" | "res.uapp" | "res.braces" | "res.iflet"
+ | "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
+ | "res.await" | "res.template" );
},
_ ) ->
false
@@ -105717,7 +105717,7 @@ let getLoc node =
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc)
| Expression e -> (
@@ -106725,7 +106725,7 @@ and walkExpression expr t comments =
let open Parsetree in
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
@@ -106784,7 +106784,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
and walkExprArgument expr t comments =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
let leading, trailing = partitionLeadingTrailing comments loc in
attach t.leading loc leading;
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -107192,7 +107192,7 @@ and walkTypeParameters typeParameters t comments =
visitListButContinueWithRemainingComments
~getLoc:(fun (_, _, typexpr) ->
match typexpr.Parsetree.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = typexpr.ptyp_loc.loc_end}
| _ -> typexpr.ptyp_loc)
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
@@ -110141,7 +110141,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
in
let loc, typ =
match typ.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
( {loc with loc_end = typ.ptyp_loc.loc_end},
{typ with ptyp_attributes = attrs} )
| _ -> (typ.ptyp_loc, typ)
@@ -112427,7 +112427,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
] ->
let loc =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc
in
@@ -112463,7 +112463,7 @@ and printJsxProp ~state arg cmtTbl =
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
{
Parsetree.pexp_attributes =
- [({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
+ [({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
} )
when lblTxt = ident (* jsx punning *) -> (
@@ -112489,7 +112489,7 @@ and printJsxProp ~state arg cmtTbl =
| lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (Location.none, expr)
in
@@ -112786,12 +112786,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Labelled lbl,
({
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} as argExpr) )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -112805,12 +112805,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
typ );
pexp_loc;
pexp_attributes =
- ([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
+ ([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
} )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match attrs with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pexp_loc.loc_end}
| _ -> arg.pexp_loc
in
@@ -112828,12 +112828,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Optional lbl,
{
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} )
when lbl = name ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
@@ -112841,7 +112841,7 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| _lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (expr.pexp_loc, expr)
in
@@ -113131,13 +113131,13 @@ and printExpFunParameter ~state parameter cmtTbl =
match defaultExpr with
| None -> (
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pattern.ppat_loc.loc_end}
| _ -> pattern.ppat_loc)
| Some expr ->
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
{
@@ -177072,7 +177072,7 @@ and parseParameter p =
Parser.next p;
let lblName, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
match p.Parser.token with
| Comma | Equal | Rparen ->
@@ -178106,7 +178106,7 @@ and parseJsxProp p =
let optional = Parser.optional p Question in
let name, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
(* optional punning: *)
if optional then
@@ -178145,7 +178145,7 @@ and parseJsxProp p =
Parser.next p;
let loc = mkLoc p.Parser.startPos p.prevEndPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let attrExpr =
let e = parsePrimaryExpr ~operand:(parseAtomicExpr p) p in
@@ -178962,7 +178962,7 @@ and parseArgument2 p ~dotted : argument option =
let endPos = p.prevEndPos in
let loc = mkLoc startPos endPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let identExpr =
Ast_helper.Exp.ident ~attrs:[propLocAttr] ~loc
@@ -179567,7 +179567,7 @@ and parseTypeParameter p =
Parser.next p;
let name, loc = parseLident p in
let lblLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
@@ -179645,7 +179645,9 @@ and parseEs6ArrowType ~attrs p =
| Tilde ->
Parser.next p;
let name, loc = parseLident p in
- let lblLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let lblLocAttr =
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
+ in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
let typ = parseTypExpr ~alias:false ~es6Arrow:false p in
diff --git a/res_syntax/benchmarks/data/Napkinscript.ml b/res_syntax/benchmarks/data/Napkinscript.ml
index 83413753403..9461374e603 100644
--- a/res_syntax/benchmarks/data/Napkinscript.ml
+++ b/res_syntax/benchmarks/data/Napkinscript.ml
@@ -3197,7 +3197,7 @@ end = struct
let filterParsingAttrs attrs =
List.filter (fun attr ->
match attr with
- | ({Location.txt = ("res.ternary" | "res.braces" | "bs" | "ns.namedArgLoc")}, _) -> false
+ | ({Location.txt = ("res.ternary" | "res.braces" | "bs" | "res.namedArgLoc")}, _) -> false
| _ -> true
) attrs
@@ -5189,7 +5189,7 @@ module CommentTable = struct
walkList
~getLoc:(fun (_argLabel, expr) ->
let loc = match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ ->
expr.pexp_loc
@@ -5207,7 +5207,7 @@ module CommentTable = struct
~getLoc:(fun (_attrs, _argLbl, exprOpt, pattern) ->
let open Parsetree in
let startPos = match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs ->
loc.loc_start
| _ ->
pattern.ppat_loc.loc_start
@@ -5279,7 +5279,7 @@ module CommentTable = struct
and walkExprArgument (_argLabel, expr) t comments =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_attrs ->
let (leading, trailing) = partitionLeadingTrailing comments loc in
attach t.leading loc leading;
let (afterLabel, rest) = partitionAdjacentTrailing loc trailing in
@@ -9599,7 +9599,7 @@ module Printer = struct
| (
(Asttypes.Labelled lblTxt | Optional lblTxt) as lbl,
{
- Parsetree.pexp_attributes = [({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
+ Parsetree.pexp_attributes = [({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
pexp_desc = Pexp_ident {txt = Longident.Lident ident}
}
) when lblTxt = ident (* jsx punning *) ->
@@ -9631,7 +9631,7 @@ module Printer = struct
end
| (lbl, expr) ->
let (argLoc, expr) = match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ ->
Location.none, expr
@@ -9845,11 +9845,11 @@ module Printer = struct
| (
(Asttypes.Labelled lbl),
({pexp_desc=Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = ([] | [({Location.txt = "ns.namedArgLoc";}, _)])
+ pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)])
} as argExpr)
) when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc = match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [
@@ -9866,11 +9866,11 @@ module Printer = struct
typ
);
pexp_loc;
- pexp_attributes = ([] | [({Location.txt = "ns.namedArgLoc";}, _)]) as attrs
+ pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)]) as attrs
}
) when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc = match attrs with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ ->
{loc with loc_end = pexp_loc.loc_end}
| _ -> arg.pexp_loc
in
@@ -9885,11 +9885,11 @@ module Printer = struct
| (
(Asttypes.Optional lbl),
{pexp_desc=Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = ([] | [({Location.txt = "ns.namedArgLoc";}, _)])
+ pexp_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)])
}
) when lbl = name ->
let loc = match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [
@@ -9900,7 +9900,7 @@ module Printer = struct
printComments doc cmtTbl loc
| (_lbl, expr) ->
let (argLoc, expr) = match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ ->
expr.pexp_loc, expr
@@ -10095,7 +10095,7 @@ module Printer = struct
| (
(Asttypes.Labelled lbl | Optional lbl),
{ppat_desc = Ppat_var stringLoc;
- ppat_attributes = ([] | [({Location.txt = "ns.namedArgLoc";}, _)])
+ ppat_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)])
}
) when lbl = stringLoc.txt ->
(* ~d *)
@@ -10106,7 +10106,7 @@ module Printer = struct
| (
(Asttypes.Labelled lbl | Optional lbl),
({ppat_desc = Ppat_constraint ({ ppat_desc = Ppat_var { txt } }, typ);
- ppat_attributes = ([] | [({Location.txt = "ns.namedArgLoc";}, _)])
+ ppat_attributes = ([] | [({Location.txt = "res.namedArgLoc";}, _)])
})
) when lbl = txt ->
(* ~d: e *)
@@ -10141,13 +10141,13 @@ module Printer = struct
let cmtLoc = match defaultExpr with
| None ->
begin match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ ->
{loc with loc_end = pattern.ppat_loc.loc_end}
| _ -> pattern.ppat_loc
end
| Some expr ->
let startPos = match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _)::_ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _)::_ ->
loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in {
@@ -13769,7 +13769,7 @@ end
| Tilde ->
Parser.next p;
let (lblName, loc) = parseLident p in
- let propLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let propLocAttr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in
begin match p.Parser.token with
| Comma | Equal | Rparen ->
let loc = mkLoc startPos p.prevEndPos in
@@ -14760,7 +14760,7 @@ end
| Question | Lident _ ->
let optional = Parser.optional p Question in
let (name, loc) = parseLident p in
- let propLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let propLocAttr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in
(* optional punning: *)
if optional then
Some (
@@ -15444,7 +15444,7 @@ end
Parser.next p;
let endPos = p.prevEndPos in
let loc = mkLoc startPos endPos in
- let propLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let propLocAttr = (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr []) in
let identExpr = Ast_helper.Exp.ident ~attrs:[propLocAttr] ~loc (
Location.mkloc (Longident.Lident ident) loc
) in
diff --git a/res_syntax/benchmarks/data/Napkinscript.res b/res_syntax/benchmarks/data/Napkinscript.res
index efff0f4e36d..e0105cf545c 100644
--- a/res_syntax/benchmarks/data/Napkinscript.res
+++ b/res_syntax/benchmarks/data/Napkinscript.res
@@ -3196,7 +3196,7 @@ module ParsetreeViewer: {
let filterParsingAttrs = attrs => List.filter(attr =>
switch attr {
- | ({Location.txt: "res.ternary" | "res.braces" | "bs" | "ns.namedArgLoc"}, _) => false
+ | ({Location.txt: "res.ternary" | "res.braces" | "bs" | "res.namedArgLoc"}, _) => false
| _ => true
}
, attrs)
@@ -5369,7 +5369,7 @@ module CommentTable = {
attach(t.trailing, callExpr.pexp_loc, afterExpr)
walkList(~getLoc=((_argLabel, expr)) => {
let loc = switch expr.Parsetree.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._attrs} => {
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._attrs} => {
...loc,
loc_end: expr.pexp_loc.loc_end,
}
@@ -5386,7 +5386,7 @@ module CommentTable = {
~getLoc=((_attrs, _argLbl, exprOpt, pattern)) => {
open Parsetree
let startPos = switch pattern.ppat_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._attrs} => loc.loc_start
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._attrs} => loc.loc_start
| _ => pattern.ppat_loc.loc_start
}
@@ -5456,7 +5456,7 @@ module CommentTable = {
and walkExprArgument = ((_argLabel, expr), t, comments) =>
switch expr.Parsetree.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._attrs} =>
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._attrs} =>
let (leading, trailing) = partitionLeadingTrailing(comments, loc)
attach(t.leading, loc, leading)
let (afterLabel, rest) = partitionAdjacentTrailing(loc, trailing)
@@ -9869,7 +9869,7 @@ module Printer = {
| (
(Asttypes.Labelled(lblTxt) | Optional(lblTxt)) as lbl,
{
- Parsetree.pexp_attributes: list{({Location.txt: "ns.namedArgLoc", loc: argLoc}, _)},
+ Parsetree.pexp_attributes: list{({Location.txt: "res.namedArgLoc", loc: argLoc}, _)},
pexp_desc: Pexp_ident({txt: Longident.Lident(ident)}),
},
) when lblTxt == ident /* jsx punning */ =>
@@ -9891,7 +9891,7 @@ module Printer = {
}
| (lbl, expr) =>
let (argLoc, expr) = switch expr.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ...attrs} => (
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ...attrs} => (
loc,
{...expr, pexp_attributes: attrs},
)
@@ -10143,11 +10143,11 @@ module Printer = {
Asttypes.Labelled(lbl),
{
pexp_desc: Pexp_ident({txt: Longident.Lident(name)}),
- pexp_attributes: list{} | list{({Location.txt: "ns.namedArgLoc"}, _)},
+ pexp_attributes: list{} | list{({Location.txt: "res.namedArgLoc"}, _)},
} as argExpr,
) when lbl == name && !ParsetreeViewer.isBracedExpr(argExpr) =>
let loc = switch arg.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._} => loc
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._} => loc
| _ => arg.pexp_loc
}
@@ -10161,11 +10161,11 @@ module Printer = {
pexp_desc:
Pexp_constraint({pexp_desc: Pexp_ident({txt: Longident.Lident(name)})} as argExpr, typ),
pexp_loc,
- pexp_attributes: (list{} | list{({Location.txt: "ns.namedArgLoc"}, _)}) as attrs,
+ pexp_attributes: (list{} | list{({Location.txt: "res.namedArgLoc"}, _)}) as attrs,
},
) when lbl == name && !ParsetreeViewer.isBracedExpr(argExpr) =>
let loc = switch attrs {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._} => {
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._} => {
...loc,
loc_end: pexp_loc.loc_end,
}
@@ -10184,11 +10184,11 @@ module Printer = {
Asttypes.Optional(lbl),
{
pexp_desc: Pexp_ident({txt: Longident.Lident(name)}),
- pexp_attributes: list{} | list{({Location.txt: "ns.namedArgLoc"}, _)},
+ pexp_attributes: list{} | list{({Location.txt: "res.namedArgLoc"}, _)},
},
) when lbl == name =>
let loc = switch arg.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._} => loc
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._} => loc
| _ => arg.pexp_loc
}
@@ -10196,7 +10196,7 @@ module Printer = {
printComments(doc, cmtTbl, loc)
| (_lbl, expr) =>
let (argLoc, expr) = switch expr.pexp_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ...attrs} => (
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ...attrs} => (
loc,
{...expr, pexp_attributes: attrs},
)
@@ -10423,7 +10423,7 @@ module Printer = {
Asttypes.Labelled(lbl) | Optional(lbl),
{
ppat_desc: Ppat_var(stringLoc),
- ppat_attributes: list{} | list{({Location.txt: "ns.namedArgLoc"}, _)},
+ ppat_attributes: list{} | list{({Location.txt: "res.namedArgLoc"}, _)},
},
) when lbl == stringLoc.txt =>
/* ~d */
@@ -10432,7 +10432,7 @@ module Printer = {
Asttypes.Labelled(lbl) | Optional(lbl),
{
ppat_desc: Ppat_constraint({ppat_desc: Ppat_var({txt})}, typ),
- ppat_attributes: list{} | list{({Location.txt: "ns.namedArgLoc"}, _)},
+ ppat_attributes: list{} | list{({Location.txt: "res.namedArgLoc"}, _)},
},
) when lbl == txt =>
/* ~d: e */
@@ -10463,7 +10463,7 @@ module Printer = {
let cmtLoc = switch defaultExpr {
| None =>
switch pattern.ppat_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._} => {
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._} => {
...loc,
loc_end: pattern.ppat_loc.loc_end,
}
@@ -10471,7 +10471,7 @@ module Printer = {
}
| Some(expr) =>
let startPos = switch pattern.ppat_attributes {
- | list{({Location.txt: "ns.namedArgLoc", loc}, _), ..._} => loc.loc_start
+ | list{({Location.txt: "res.namedArgLoc", loc}, _), ..._} => loc.loc_start
| _ => pattern.ppat_loc.loc_start
}
{
@@ -14370,7 +14370,7 @@ Solution: directly use `concat`."
| Tilde =>
Parser.next(p)
let (lblName, loc) = parseLident(p)
- let propLocAttr = (Location.mkloc("ns.namedArgLoc", loc), Parsetree.PStr(list{}))
+ let propLocAttr = (Location.mkloc("res.namedArgLoc", loc), Parsetree.PStr(list{}))
switch p.Parser.token {
| Comma | Equal | Rparen =>
let loc = mkLoc(startPos, p.prevEndPos)
@@ -15526,7 +15526,7 @@ Solution: directly use `concat`."
| Question | Lident(_) =>
let optional = Parser.optional(p, Question)
let (name, loc) = parseLident(p)
- let propLocAttr = (Location.mkloc("ns.namedArgLoc", loc), Parsetree.PStr(list{}))
+ let propLocAttr = (Location.mkloc("res.namedArgLoc", loc), Parsetree.PStr(list{}))
/* optional punning: */
if optional {
Some(
@@ -16272,7 +16272,7 @@ Solution: directly use `concat`."
Parser.next(p)
let endPos = p.prevEndPos
let loc = mkLoc(startPos, endPos)
- let propLocAttr = (Location.mkloc("ns.namedArgLoc", loc), Parsetree.PStr(list{}))
+ let propLocAttr = (Location.mkloc("res.namedArgLoc", loc), Parsetree.PStr(list{}))
let identExpr = Ast_helper.Exp.ident(
~attrs=list{propLocAttr},
~loc,
diff --git a/res_syntax/src/res_comments_table.ml b/res_syntax/src/res_comments_table.ml
index 4ad2d7bd8bb..ed07ec2f973 100644
--- a/res_syntax/src/res_comments_table.ml
+++ b/res_syntax/src/res_comments_table.ml
@@ -349,7 +349,7 @@ let getLoc node =
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc)
| Expression e -> (
@@ -1357,7 +1357,7 @@ and walkExpression expr t comments =
let open Parsetree in
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
@@ -1416,7 +1416,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
and walkExprArgument expr t comments =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
let leading, trailing = partitionLeadingTrailing comments loc in
attach t.leading loc leading;
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -1824,7 +1824,7 @@ and walkTypeParameters typeParameters t comments =
visitListButContinueWithRemainingComments
~getLoc:(fun (_, _, typexpr) ->
match typexpr.Parsetree.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = typexpr.ptyp_loc.loc_end}
| _ -> typexpr.ptyp_loc)
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
diff --git a/res_syntax/src/res_core.ml b/res_syntax/src/res_core.ml
index 81a7f494c91..e0313ff78ad 100644
--- a/res_syntax/src/res_core.ml
+++ b/res_syntax/src/res_core.ml
@@ -1648,7 +1648,7 @@ and parseParameter p =
Parser.next p;
let lblName, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
match p.Parser.token with
| Comma | Equal | Rparen ->
@@ -2682,7 +2682,7 @@ and parseJsxProp p =
let optional = Parser.optional p Question in
let name, loc = parseLident p in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
(* optional punning: *)
if optional then
@@ -2721,7 +2721,7 @@ and parseJsxProp p =
Parser.next p;
let loc = mkLoc p.Parser.startPos p.prevEndPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let attrExpr =
let e = parsePrimaryExpr ~operand:(parseAtomicExpr p) p in
@@ -3538,7 +3538,7 @@ and parseArgument2 p ~dotted : argument option =
let endPos = p.prevEndPos in
let loc = mkLoc startPos endPos in
let propLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
let identExpr =
Ast_helper.Exp.ident ~attrs:[propLocAttr] ~loc
@@ -4143,7 +4143,7 @@ and parseTypeParameter p =
Parser.next p;
let name, loc = parseLident p in
let lblLocAttr =
- (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
@@ -4221,7 +4221,9 @@ and parseEs6ArrowType ~attrs p =
| Tilde ->
Parser.next p;
let name, loc = parseLident p in
- let lblLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
+ let lblLocAttr =
+ (Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
+ in
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
let typ =
let typ = parseTypExpr ~alias:false ~es6Arrow:false p in
diff --git a/res_syntax/src/res_parsetree_viewer.ml b/res_syntax/src/res_parsetree_viewer.ml
index b0a9ad08810..a53a1fc7475 100644
--- a/res_syntax/src/res_parsetree_viewer.ml
+++ b/res_syntax/src/res_parsetree_viewer.ml
@@ -208,9 +208,9 @@ let filterParsingAttrs attrs =
match attr with
| ( {
Location.txt =
- ( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
- | "res.optional" | "res.ternary" | "res.async" | "res.await"
- | "res.template" );
+ ( "bs" | "res.uapp" | "res.braces" | "res.iflet"
+ | "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
+ | "res.await" | "res.template" );
},
_ ) ->
false
diff --git a/res_syntax/src/res_printer.ml b/res_syntax/src/res_printer.ml
index 9b86e28ffcb..2afc6973f6f 100644
--- a/res_syntax/src/res_printer.ml
+++ b/res_syntax/src/res_printer.ml
@@ -1925,7 +1925,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
in
let loc, typ =
match typ.ptyp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
( {loc with loc_end = typ.ptyp_loc.loc_end},
{typ with ptyp_attributes = attrs} )
| _ -> (typ.ptyp_loc, typ)
@@ -4211,7 +4211,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
] ->
let loc =
match expr.Parsetree.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
{loc with loc_end = expr.pexp_loc.loc_end}
| _ -> expr.pexp_loc
in
@@ -4247,7 +4247,7 @@ and printJsxProp ~state arg cmtTbl =
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
{
Parsetree.pexp_attributes =
- [({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
+ [({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
} )
when lblTxt = ident (* jsx punning *) -> (
@@ -4273,7 +4273,7 @@ and printJsxProp ~state arg cmtTbl =
| lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (Location.none, expr)
in
@@ -4570,12 +4570,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Labelled lbl,
({
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} as argExpr) )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -4589,12 +4589,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
typ );
pexp_loc;
pexp_attributes =
- ([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
+ ([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
} )
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
let loc =
match attrs with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pexp_loc.loc_end}
| _ -> arg.pexp_loc
in
@@ -4612,12 +4612,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| ( Asttypes.Optional lbl,
{
pexp_desc = Pexp_ident {txt = Longident.Lident name};
- pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
+ pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
} )
when lbl = name ->
let loc =
match arg.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
| _ -> arg.pexp_loc
in
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
@@ -4625,7 +4625,7 @@ and printArgument ~state (argLbl, arg) cmtTbl =
| _lbl, expr ->
let argLoc, expr =
match expr.pexp_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
(loc, {expr with pexp_attributes = attrs})
| _ -> (expr.pexp_loc, expr)
in
@@ -4915,13 +4915,13 @@ and printExpFunParameter ~state parameter cmtTbl =
match defaultExpr with
| None -> (
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
{loc with loc_end = pattern.ppat_loc.loc_end}
| _ -> pattern.ppat_loc)
| Some expr ->
let startPos =
match pattern.ppat_attributes with
- | ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
+ | ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
| _ -> pattern.ppat_loc.loc_start
in
{
diff --git a/res_syntax/tests/parsing/errors/expressions/expected/block.res.txt b/res_syntax/tests/parsing/errors/expressions/expected/block.res.txt
index 1f6a2a1b285..96fa794985f 100644
--- a/res_syntax/tests/parsing/errors/expressions/expected/block.res.txt
+++ b/res_syntax/tests/parsing/errors/expressions/expected/block.res.txt
@@ -63,8 +63,8 @@
Looks like there might be an expression missing here
-let findThreadByIdLinearScan ~threads:((threads)[@ns.namedArgLoc ])
- ~id:((id)[@ns.namedArgLoc ]) =
+let findThreadByIdLinearScan ~threads:((threads)[@res.namedArgLoc ])
+ ~id:((id)[@res.namedArgLoc ]) =
((Js.Array2.findi ThreadsModel.threads
(fun thread ->
fun i ->
diff --git a/res_syntax/tests/parsing/errors/expressions/expected/jsx.res.txt b/res_syntax/tests/parsing/errors/expressions/expected/jsx.res.txt
index 1bdaf68bf54..ca61b12c08c 100644
--- a/res_syntax/tests/parsing/errors/expressions/expected/jsx.res.txt
+++ b/res_syntax/tests/parsing/errors/expressions/expected/jsx.res.txt
@@ -76,5 +76,5 @@ let x =
let x =
((Foo.bar.createElement ~children:[] ())[@JSX ]) > ([%rescript.exprhole ])
let x =
- ((Foo.bar.createElement ~baz:((baz)[@ns.namedArgLoc ]) ~children:[] ())
+ ((Foo.bar.createElement ~baz:((baz)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/errors/other/expected/labelledParameters.res.txt b/res_syntax/tests/parsing/errors/other/expected/labelledParameters.res.txt
index 886996e1610..162d9ed152e 100644
--- a/res_syntax/tests/parsing/errors/other/expected/labelledParameters.res.txt
+++ b/res_syntax/tests/parsing/errors/other/expected/labelledParameters.res.txt
@@ -32,6 +32,6 @@
A labeled parameter starts with a `~`. Did you mean: `~x`?
let f x ?(y= 2) z = (x + y) + z
-let g ~x:((x)[@ns.namedArgLoc ]) ?y:(((y)[@ns.namedArgLoc ])= 2)
- ~z:((z)[@ns.namedArgLoc ]) = (x + y) + z
+let g ~x:((x)[@res.namedArgLoc ]) ?y:(((y)[@res.namedArgLoc ])= 2)
+ ~z:((z)[@res.namedArgLoc ]) = (x + y) + z
type nonrec f = x:int -> y:int -> int
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/errors/other/expected/regionMissingComma.res.txt b/res_syntax/tests/parsing/errors/other/expected/regionMissingComma.res.txt
index 32b0e6ae432..1352f7d960b 100644
--- a/res_syntax/tests/parsing/errors/other/expected/regionMissingComma.res.txt
+++ b/res_syntax/tests/parsing/errors/other/expected/regionMissingComma.res.txt
@@ -23,8 +23,8 @@
Did you forget a `,` here?
external make :
- ?style:((ReactDOMRe.Style.t)[@ns.namedArgLoc ]) ->
- (?image:((bool)[@ns.namedArgLoc ]) -> React.element) Js.Fn.arity1 =
+ ?style:((ReactDOMRe.Style.t)[@res.namedArgLoc ]) ->
+ (?image:((bool)[@res.namedArgLoc ]) -> React.element) Js.Fn.arity1 =
"ModalContent"
type nonrec 'extraInfo student =
{
diff --git a/res_syntax/tests/parsing/errors/structure/expected/gh16B.res.txt b/res_syntax/tests/parsing/errors/structure/expected/gh16B.res.txt
index 31b7f4f06fa..e35185e0ad7 100644
--- a/res_syntax/tests/parsing/errors/structure/expected/gh16B.res.txt
+++ b/res_syntax/tests/parsing/errors/structure/expected/gh16B.res.txt
@@ -35,6 +35,6 @@ module ClientSet =
(b |. Client.getUniqueId))
[@res.braces ])
end)
- let empty = Belt.Set.make ~id:(((module T))[@ns.namedArgLoc ])
+ let empty = Belt.Set.make ~id:(((module T))[@res.namedArgLoc ])
end
;;Js.log {js|test|js}
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/errors/typexpr/expected/arrow.res.txt b/res_syntax/tests/parsing/errors/typexpr/expected/arrow.res.txt
index 39e55022cd4..264001c3280 100644
--- a/res_syntax/tests/parsing/errors/typexpr/expected/arrow.res.txt
+++ b/res_syntax/tests/parsing/errors/typexpr/expected/arrow.res.txt
@@ -40,7 +40,7 @@ module Error2 =
{
observed: int ;
onStep:
- currentValue:((unit)[@ns.namedArgLoc ]) -> [%rescript.typehole ] }
+ currentValue:((unit)[@res.namedArgLoc ]) -> [%rescript.typehole ] }
end
module Error3 =
struct
@@ -48,5 +48,5 @@ module Error3 =
{
observed: int ;
onStep:
- currentValue:((unit)[@ns.namedArgLoc ]) -> [%rescript.typehole ] }
+ currentValue:((unit)[@res.namedArgLoc ]) -> [%rescript.typehole ] }
end
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/errors/typexpr/expected/garbage.res.txt b/res_syntax/tests/parsing/errors/typexpr/expected/garbage.res.txt
index 3c171a7c819..9c72278428b 100644
--- a/res_syntax/tests/parsing/errors/typexpr/expected/garbage.res.txt
+++ b/res_syntax/tests/parsing/errors/typexpr/expected/garbage.res.txt
@@ -8,5 +8,5 @@
I'm not sure what to parse here when looking at "?".
-external printName : name:((unit)[@ns.namedArgLoc ]) -> unit = "printName"
+external printName : name:((unit)[@res.namedArgLoc ]) -> unit = "printName"
[@@bs.module {js|moduleName|js}]
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/apply.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/apply.res.txt
index df4d3772fed..218f3416996 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/apply.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/apply.res.txt
@@ -5,4 +5,4 @@
;;List.map (fun x -> x + 1) myList
;;List.reduce (fun acc -> fun curr -> acc + curr) 0 myList
let unitUncurried = ((apply ())[@res.uapp ])
-;;call ~a:(((((a)[@ns.namedArgLoc ]) : int))[@ns.namedArgLoc ])
\ No newline at end of file
+;;call ~a:(((((a)[@res.namedArgLoc ]) : int))[@res.namedArgLoc ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/argument.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/argument.res.txt
index 95177eac2cb..12a91a2750c 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/argument.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/argument.res.txt
@@ -1,13 +1,13 @@
-let foo ~a:((a)[@ns.namedArgLoc ]) =
+let foo ~a:((a)[@res.namedArgLoc ]) =
((a (let __res_unit = () in __res_unit))[@res.uapp ]) +. 1.
let a = { Js.Fn.I1 = (fun () -> 2) }
-let bar = foo ~a:((a)[@ns.namedArgLoc ])
+let bar = foo ~a:((a)[@res.namedArgLoc ])
let comparisonResult =
- ((compare currentNode.value ~targetValue:((targetValue)[@ns.namedArgLoc ]))
+ ((compare currentNode.value ~targetValue:((targetValue)[@res.namedArgLoc ]))
[@res.uapp ])
-;;((callback firstNode ~y:((y)[@ns.namedArgLoc ]))[@res.uapp ])
+;;((callback firstNode ~y:((y)[@res.namedArgLoc ]))[@res.uapp ])
;;((document.createElementWithOptions {js|div|js}
(elementProps ~onClick:((fun _ -> Js.log {js|hello world|js})
- [@ns.namedArgLoc ])))[@res.uapp ])
+ [@res.namedArgLoc ])))[@res.uapp ])
;;((resolve ())[@res.uapp ])
;;((resolve (let __res_unit = () in __res_unit))[@res.uapp ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/arrow.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/arrow.res.txt
index 08844ba5026..fe1a6abe7b6 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/arrow.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/arrow.res.txt
@@ -22,22 +22,22 @@ let f (lazy x) (lazy y) = ()
let f [] = ()
let f (x::xs) = x + (xs |. Belt.List.length)
let f (x : int) (y : int) = x + y
-let f ~a:((a)[@ns.namedArgLoc ]) ~b:((b)[@ns.namedArgLoc ]) = a + b
-let f ~a:((x)[@ns.namedArgLoc ]) ~b:((y)[@ns.namedArgLoc ]) = x + y
-let f ~a:(((x : int))[@ns.namedArgLoc ]) ~b:(((y : int))[@ns.namedArgLoc ])
- = x + y
-let f ?a:(((a)[@ns.namedArgLoc ])= 1) ?b:(((b)[@ns.namedArgLoc ])= 2) c =
+let f ~a:((a)[@res.namedArgLoc ]) ~b:((b)[@res.namedArgLoc ]) = a + b
+let f ~a:((x)[@res.namedArgLoc ]) ~b:((y)[@res.namedArgLoc ]) = x + y
+let f ~a:(((x : int))[@res.namedArgLoc ])
+ ~b:(((y : int))[@res.namedArgLoc ]) = x + y
+let f ?a:(((a)[@res.namedArgLoc ])= 1) ?b:(((b)[@res.namedArgLoc ])= 2) c =
(a + b) + c
-let f ?a:(((x)[@ns.namedArgLoc ])= 1) ?b:(((y)[@ns.namedArgLoc ])= 2) c =
+let f ?a:(((x)[@res.namedArgLoc ])= 1) ?b:(((y)[@res.namedArgLoc ])= 2) c =
(x + y) + c
-let f ?a:((((x : int))[@ns.namedArgLoc ])= 1)
- ?b:((((y : int))[@ns.namedArgLoc ])= 2) c = (x + y) + c
-let f ?a:((a)[@ns.namedArgLoc ]) ?b:((b)[@ns.namedArgLoc ]) c =
+let f ?a:((((x : int))[@res.namedArgLoc ])= 1)
+ ?b:((((y : int))[@res.namedArgLoc ])= 2) c = (x + y) + c
+let f ?a:((a)[@res.namedArgLoc ]) ?b:((b)[@res.namedArgLoc ]) c =
match (a, b) with | (Some a, Some b) -> (a + b) + c | _ -> 3
-let f ?a:((x)[@ns.namedArgLoc ]) ?b:((y)[@ns.namedArgLoc ]) c =
+let f ?a:((x)[@res.namedArgLoc ]) ?b:((y)[@res.namedArgLoc ]) c =
match (x, y) with | (Some a, Some b) -> (a + b) + c | _ -> 3
-let f ?a:(((x : int option))[@ns.namedArgLoc ])
- ?b:(((y : int option))[@ns.namedArgLoc ]) c =
+let f ?a:(((x : int option))[@res.namedArgLoc ])
+ ?b:(((y : int option))[@res.namedArgLoc ]) c =
match (x, y) with | (Some a, Some b) -> (a + b) + c | _ -> 3
let f a b = a + b
let f = { Js.Fn.I1 = (fun () -> ()) }
@@ -53,21 +53,21 @@ let f =
let f =
{
Js.Fn.I2 =
- (fun ~a:((a)[@ns.namedArgLoc ][@attr ]) ->
+ (fun ~a:((a)[@res.namedArgLoc ][@attr ]) ->
fun b ->
{
Js.Fn.I2 =
- (fun ~c:((c)[@ns.namedArgLoc ][@attr ]) -> fun d -> ())
+ (fun ~c:((c)[@res.namedArgLoc ][@attr ]) -> fun d -> ())
})
}
let f =
{
Js.Fn.I2 =
- (fun ~a:((a)[@ns.namedArgLoc ][@attr ]) ->
+ (fun ~a:((a)[@res.namedArgLoc ][@attr ]) ->
fun ((b)[@attrOnB ]) ->
{
Js.Fn.I2 =
- (fun ~c:((c)[@ns.namedArgLoc ][@attr ]) ->
+ (fun ~c:((c)[@res.namedArgLoc ][@attr ]) ->
fun ((d)[@attrOnD ]) -> ())
})
}
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/async.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/async.res.txt
index f40cffb1c4d..1965d81b0f2 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/async.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/async.res.txt
@@ -32,9 +32,9 @@ let f =
then ((fun a -> fun b -> (a + b : int))[@res.async ])
else (((fun c -> fun d -> (c - d : int)))[@res.async ]))
[@res.ternary ])
-let foo = async ~a:((34)[@ns.namedArgLoc ])
-let bar = ((fun ~a:((a)[@ns.namedArgLoc ]) -> a + 1)[@res.async ])
+let foo = async ~a:((34)[@res.namedArgLoc ])
+let bar = ((fun ~a:((a)[@res.namedArgLoc ]) -> a + 1)[@res.async ])
let ex1 = ((3)[@res.await ]) + ((4)[@res.await ])
let ex2 = ((3)[@res.await ]) ** ((4)[@res.await ])
-let ex3 = ((foo |. (bar ~arg:((arg)[@ns.namedArgLoc ])))[@res.await ])
+let ex3 = ((foo |. (bar ~arg:((arg)[@res.namedArgLoc ])))[@res.await ])
let ex4 = (((foo.bar).baz)[@res.await ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/binaryNoEs6Arrow.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/binaryNoEs6Arrow.res.txt
index 7c157297e03..aa35b4d627b 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/binaryNoEs6Arrow.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/binaryNoEs6Arrow.res.txt
@@ -29,6 +29,6 @@
({ startTime = (percent *. duration) } : Video.chapter) in
{ a; b } |. onChange
| _ -> ())
- [@res.braces ]))[@ns.namedArgLoc ][@res.braces ])
+ [@res.braces ]))[@res.namedArgLoc ][@res.braces ])
~children:[] ())[@JSX ])
;;if inclusions.(index) <- (uid, url) then onChange inclusions
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/firstClassModule.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/firstClassModule.res.txt
index 0a10f0ea31c..478dfe378c1 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/firstClassModule.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/firstClassModule.res.txt
@@ -36,8 +36,8 @@ let build_dispatch_table handlers =
~f:((fun (((module I) : (module Query_handler_instance)) as instance)
->
Hashtbl.set table ~key:((I.Query_handler.name)
- [@ns.namedArgLoc ]) ~data:((instance)[@ns.namedArgLoc ]))
- [@ns.namedArgLoc ]) table)
+ [@res.namedArgLoc ]) ~data:((instance)[@res.namedArgLoc ]))
+ [@res.namedArgLoc ]) table)
[@res.braces ])
;;(module Three)
;;((module Three) : (module X_int))
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/jsx.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/jsx.res.txt
index 84707fd802a..fccf7675bdc 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/jsx.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/jsx.res.txt
@@ -1,28 +1,28 @@
let _ = ((div ~children:[] ())[@JSX ])
let _ = ((div ~children:[] ())[@JSX ])
-let _ = ((div ~className:(({js|menu|js})[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((div ~className:(({js|menu|js})[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
-let _ = ((div ~className:(({js|menu|js})[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((div ~className:(({js|menu|js})[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
-let _ = ((div ~className:(({js|menu|js})[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((div ~className:(({js|menu|js})[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
-let _ = ((div ~className:(({js|menu|js})[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((div ~className:(({js|menu|js})[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let _ =
- ((div ~className:(({js|menu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|menu|js})[@res.namedArgLoc ])
~onClick:((fun _ -> Js.log {js|click|js})
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
- ((div ~className:(({js|menu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|menu|js})[@res.namedArgLoc ])
~onClick:((fun _ -> Js.log {js|click|js})
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ = ((Navbar.createElement ~children:[] ())[@JSX ])
let _ = ((Navbar.createElement ~children:[] ())[@JSX ])
let _ = ((Navbar.createElement ~children:[] ())[@JSX ])
let _ =
- ((Navbar.createElement ~className:(({js|menu|js})[@ns.namedArgLoc ])
+ ((Navbar.createElement ~className:(({js|menu|js})[@res.namedArgLoc ])
~children:[] ())
[@JSX ])
let _ = ((Dot.Up.createElement ~children:[] ())[@JSX ])
@@ -37,7 +37,7 @@ let _ =
~children:[((Dot.Up.createElement ~children:[] ())[@JSX ])] ())
[@JSX ])
let _ =
- ((Dot.Up.createElement ~className:(({js|menu|js})[@ns.namedArgLoc ])
+ ((Dot.Up.createElement ~className:(({js|menu|js})[@res.namedArgLoc ])
~children:[] ())
[@JSX ])
let _ = ((Dot.low.createElement ~children:[] ())[@JSX ])
@@ -52,32 +52,32 @@ let _ =
~children:[((Dot.low.createElement ~children:[] ())[@JSX ])] ())
[@JSX ])
let _ =
- ((Dot.low.createElement ~className:(({js|menu|js})[@ns.namedArgLoc ])
+ ((Dot.low.createElement ~className:(({js|menu|js})[@res.namedArgLoc ])
~children:[] ())
[@JSX ])
-let _ = ((el ~punned:((punned)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
-let _ = ((el ?punned:((punned)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
-let _ = ((el ~punned:((punned)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
-let _ = ((el ?punned:((punned)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
-let _ = ((el ?a:((b)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
-let _ = ((el ?a:((b)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ~punned:((punned)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ?punned:((punned)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ~punned:((punned)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ?punned:((punned)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ?a:((b)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((el ?a:((b)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
let _ = (([])[@JSX ])
let _ = (([])[@JSX ])
let _ =
- ((div ~className:(({js|menu|js})[@ns.namedArgLoc ])
- ~children:[((div ~className:(({js|submenu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|menu|js})[@res.namedArgLoc ])
+ ~children:[((div ~className:(({js|submenu|js})[@res.namedArgLoc ])
~children:[sub1] ())
[@JSX ]);
- ((div ~className:(({js|submenu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|submenu|js})[@res.namedArgLoc ])
~children:[sub2] ())
[@JSX ])] ())
[@JSX ])
let _ =
- ((div ~className:(({js|menu|js})[@ns.namedArgLoc ])
- ~children:[((div ~className:(({js|submenu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|menu|js})[@res.namedArgLoc ])
+ ~children:[((div ~className:(({js|submenu|js})[@res.namedArgLoc ])
~children:[sub1] ())
[@JSX ]);
- ((div ~className:(({js|submenu|js})[@ns.namedArgLoc ])
+ ((div ~className:(({js|submenu|js})[@res.namedArgLoc ])
~children:[sub2] ())
[@JSX ])] ())
[@JSX ])
@@ -95,10 +95,10 @@ let _ =
[@JSX ])
let _ =
((Outer.createElement ~inner:((Inner.createElement ~children:[] ())
- [@ns.namedArgLoc ][@JSX ]) ~children:[] ())
+ [@res.namedArgLoc ][@JSX ]) ~children:[] ())
[@JSX ])
let _ =
- ((div ~onClick:((onClickHandler)[@ns.namedArgLoc ])
+ ((div ~onClick:((onClickHandler)[@res.namedArgLoc ])
~children:[(([{js|foobar|js}])[@JSX ])] ())
[@JSX ])
let _ =
@@ -110,10 +110,10 @@ let _ =
paddingLeft = 10;
paddingRight = 10;
paddingBottom = 10
- })[@ns.namedArgLoc ]) ~children:[] ())
+ })[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let _ =
- ((OverEager.createElement ~fiber:((Metal.fiber)[@ns.namedArgLoc ])
+ ((OverEager.createElement ~fiber:((Metal.fiber)[@res.namedArgLoc ])
~children:[] ())
[@JSX ])
let arrayOfListOfJsx = [|(([])[@JSX ])|]
@@ -146,8 +146,8 @@ let _ = ((a ~children:[] ())[@JSX ]) > ((b ~children:[] ())[@JSX ])
let _ = ((a ~children:[] ())[@JSX ]) < ((b ~children:[] ())[@JSX ])
let _ = ((a ~children:[] ())[@JSX ]) > ((b ~children:[] ())[@JSX ])
let y =
- ((Routes.createElement ~path:((Routes.stateToPath state)[@ns.namedArgLoc ])
- ~isHistorical:((true)[@ns.namedArgLoc ])
+ ((Routes.createElement ~path:((Routes.stateToPath state)
+ [@res.namedArgLoc ]) ~isHistorical:((true)[@res.namedArgLoc ])
~onHashChange:((fun _oldPath ->
fun _oldUrl ->
fun newUrl ->
@@ -168,20 +168,20 @@ let y =
latestComponentBag ())
[@res.ternary ]))
[@res.braces ])) ())
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let z =
((div
- ~style:((ReactDOMRe.Style.make ~width:((width)[@ns.namedArgLoc ])
- ~height:((height)[@ns.namedArgLoc ]) ~color:((color)
- [@ns.namedArgLoc ]) ~backgroundColor:((backgroundColor)
- [@ns.namedArgLoc ]) ~margin:((margin)[@ns.namedArgLoc ])
- ~padding:((padding)[@ns.namedArgLoc ]) ~border:((border)
- [@ns.namedArgLoc ]) ~borderColor:((borderColor)
- [@ns.namedArgLoc ])
- ~someOtherAttribute:((someOtherAttribute)[@ns.namedArgLoc ])
- ())[@ns.namedArgLoc ]) ~key:((string_of_int 1)
- [@ns.namedArgLoc ]) ~children:[] ())
+ ~style:((ReactDOMRe.Style.make ~width:((width)[@res.namedArgLoc ])
+ ~height:((height)[@res.namedArgLoc ]) ~color:((color)
+ [@res.namedArgLoc ]) ~backgroundColor:((backgroundColor)
+ [@res.namedArgLoc ]) ~margin:((margin)[@res.namedArgLoc ])
+ ~padding:((padding)[@res.namedArgLoc ]) ~border:((border)
+ [@res.namedArgLoc ]) ~borderColor:((borderColor)
+ [@res.namedArgLoc ])
+ ~someOtherAttribute:((someOtherAttribute)
+ [@res.namedArgLoc ]) ())[@res.namedArgLoc ])
+ ~key:((string_of_int 1)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let omega =
((div
@@ -193,21 +193,21 @@ let omega =
padding;
border;
borderColor;
- someOtherAttribute])[@ns.namedArgLoc ])
- ~key:((string_of_int 1)[@ns.namedArgLoc ]) ~children:[] ())
+ someOtherAttribute])[@res.namedArgLoc ])
+ ~key:((string_of_int 1)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let someArray =
((div
~anArray:(([|width;height;color;backgroundColor;margin;padding;border;borderColor;someOtherAttribute|])
- [@ns.namedArgLoc ]) ~key:((string_of_int 1)[@ns.namedArgLoc ])
+ [@res.namedArgLoc ]) ~key:((string_of_int 1)[@res.namedArgLoc ])
~children:[] ())
[@JSX ])
let tuples =
((div
~aTuple:(((width, height, color, backgroundColor, margin, padding,
border, borderColor, someOtherAttribute,
- definitelyBreakere))[@ns.namedArgLoc ])
- ~key:((string_of_int 1)[@ns.namedArgLoc ]) ~children:[] ())
+ definitelyBreakere))[@res.namedArgLoc ])
+ ~key:((string_of_int 1)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let icon =
((Icon.createElement
@@ -215,121 +215,121 @@ let icon =
| v when v < 0.1 -> {js|sound-off|js}
| v when v < 0.11 -> {js|sound-min|js}
| v when v < 0.51 -> {js|sound-med|js}
- | _ -> {js|sound-max|js})[@ns.namedArgLoc ][@res.braces ])
+ | _ -> {js|sound-max|js})[@res.namedArgLoc ][@res.braces ])
~children:[] ())
[@JSX ])
let _ =
((MessengerSharedPhotosAlbumViewPhotoReact.createElement
?ref:((if foo#bar == baz
then Some (foooooooooooooooooooooooo setRefChild)
- else None)[@ns.namedArgLoc ][@res.ternary ])
- ~key:((node#legacy_attachment_id)[@ns.namedArgLoc ]) ~children:[] ())
+ else None)[@res.namedArgLoc ][@res.ternary ])
+ ~key:((node#legacy_attachment_id)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
-let _ = ((Foo.createElement ~bar:((bar)[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((Foo.createElement ~bar:((bar)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
-let _ = ((Foo.createElement ?bar:((bar)[@ns.namedArgLoc ]) ~children:[] ())
+let _ = ((Foo.createElement ?bar:((bar)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let _ =
- ((Foo.createElement ?bar:((Baz.bar)[@ns.namedArgLoc ]) ~children:[] ())
+ ((Foo.createElement ?bar:((Baz.bar)[@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
let x = ((div ~children:[] ())[@JSX ])
-let _ = ((div ~asd:((1)[@ns.namedArgLoc ]) ~children:[] ())[@JSX ])
+let _ = ((div ~asd:((1)[@res.namedArgLoc ]) ~children:[] ())[@JSX ])
;;foo#bar #= ((bar ~children:[] ())[@JSX ])
;;foo #= ((bar ~children:[] ())[@JSX ])
;;foo #= ((bar ~children:[] ())[@JSX ])
let x = [|((div ~children:[] ())[@JSX ])|]
let z = ((div ~children:[] ())[@JSX ])
let z =
- (((Button.createElement ~onClick:((handleStaleClick)[@ns.namedArgLoc ])
+ (((Button.createElement ~onClick:((handleStaleClick)[@res.namedArgLoc ])
~children:[] ())[@JSX ]),
- ((Button.createElement ~onClick:((handleStaleClick)[@ns.namedArgLoc ])
+ ((Button.createElement ~onClick:((handleStaleClick)[@res.namedArgLoc ])
~children:[] ())[@JSX ]))
let y = [|((div ~children:[] ())[@JSX ]);((div ~children:[] ())[@JSX ])|]
let y =
- [|((Button.createElement ~onClick:((handleStaleClick)[@ns.namedArgLoc ])
+ [|((Button.createElement ~onClick:((handleStaleClick)[@res.namedArgLoc ])
~children:[] ())
[@JSX ]);((Button.createElement ~onClick:((handleStaleClick)
- [@ns.namedArgLoc ]) ~children:[] ())
+ [@res.namedArgLoc ]) ~children:[] ())
[@JSX ])|]
let _ =
((Description.createElement
- ~term:((Text.createElement ~text:(({js|Age|js})[@ns.namedArgLoc ])
- ~children:[] ())[@ns.namedArgLoc ][@res.braces ][@JSX ])
+ ~term:((Text.createElement ~text:(({js|Age|js})[@res.namedArgLoc ])
+ ~children:[] ())[@res.namedArgLoc ][@res.braces ][@JSX ])
~children:[child] ())
[@JSX ])
let _ =
((Description.createElement
- ~term:((Text.createElement ~text:(({js|Age|js})[@ns.namedArgLoc ])
- ~children:(([||])[@ns.namedArgLoc ]) ())
- [@ns.namedArgLoc ][@res.braces ]) ~children:[child] ())
+ ~term:((Text.createElement ~text:(({js|Age|js})[@res.namedArgLoc ])
+ ~children:(([||])[@res.namedArgLoc ]) ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[child] ())
[@JSX ])
let _ =
((Description.createElement
- ~term:((Text.createElement ~text:(({js|Age|js})[@ns.namedArgLoc ]) ())
- [@ns.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
+ ~term:((Text.createElement ~text:(({js|Age|js})[@res.namedArgLoc ]) ())
+ [@res.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
[@JSX ])
let _ =
((Description.createElement
~term:((Text.createElement ~superLongPunnedProp:((superLongPunnedProp)
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~anotherSuperLongOneCrazyLongThingHere:((anotherSuperLongOneCrazyLongThingHere)
- [@ns.namedArgLoc ]) ~text:(({js|Age|js})[@ns.namedArgLoc ])
- ~children:[] ())[@ns.namedArgLoc ][@res.braces ][@JSX ])
+ [@res.namedArgLoc ]) ~text:(({js|Age|js})[@res.namedArgLoc ])
+ ~children:[] ())[@res.namedArgLoc ][@res.braces ][@JSX ])
~children:[child] ())
[@JSX ])
let _ =
((Foo.createElement
~bar:((Baz.createElement ~superLongPunnedProp:((superLongPunnedProp)
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~anotherSuperLongOneCrazyLongThingHere:((anotherSuperLongOneCrazyLongThingHere)
- [@ns.namedArgLoc ]) ~children:[] ())
- [@ns.namedArgLoc ][@res.braces ][@JSX ]) ~children:[] ())
+ [@res.namedArgLoc ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ][@JSX ]) ~children:[] ())
[@JSX ])
let _ =
((div ~children:[((span ~children:[str {js|hello|js}] ())[@JSX ])] ())
[@JSX ])
let _ =
((description
- ~term:((text ~text:(({js|Age|js})[@ns.namedArgLoc ]) ~children:[] ())
- [@ns.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
+ ~term:((text ~text:(({js|Age|js})[@res.namedArgLoc ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
[@JSX ])
let _ =
((description
- ~term:((text ~text:(({js|Age|js})[@ns.namedArgLoc ]) ~children:((
- [||])[@ns.namedArgLoc ]) ())[@ns.namedArgLoc ][@res.braces ])
- ~children:[child] ())
+ ~term:((text ~text:(({js|Age|js})[@res.namedArgLoc ]) ~children:((
+ [||])[@res.namedArgLoc ]) ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[child] ())
[@JSX ])
let _ =
((description
- ~term:((text ~text:(({js|Age|js})[@ns.namedArgLoc ]) ~children:((
- [||])[@ns.namedArgLoc ]))
- [@ns.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
+ ~term:((text ~text:(({js|Age|js})[@res.namedArgLoc ]) ~children:((
+ [||])[@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
[@JSX ])
let _ =
- ((description ~term:((text ~text:(({js|Age|js})[@ns.namedArgLoc ]) ())
- [@ns.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
+ ((description ~term:((text ~text:(({js|Age|js})[@res.namedArgLoc ]) ())
+ [@res.namedArgLoc ][@res.braces ][@JSX ]) ~children:[child] ())
[@JSX ])
let _ =
((description
~term:((div ~superLongPunnedProp:((superLongPunnedProp)
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~anotherSuperLongOneCrazyLongThingHere:((anotherSuperLongOneCrazyLongThingHere)
- [@ns.namedArgLoc ]) ~text:(({js|Age|js})[@ns.namedArgLoc ])
- ~children:[] ())[@ns.namedArgLoc ][@res.braces ][@JSX ])
+ [@res.namedArgLoc ]) ~text:(({js|Age|js})[@res.namedArgLoc ])
+ ~children:[] ())[@res.namedArgLoc ][@res.braces ][@JSX ])
~children:[child] ())
[@JSX ])
let _ =
((div ~onClick:((fun event -> handleChange event)
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div ~onClick:((fun eventWithLongIdent -> handleChange eventWithLongIdent)
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div
~onClick:((fun event -> ((Js.log event; handleChange event)
- [@res.braces ]))[@ns.namedArgLoc ][@res.braces ])
+ [@res.braces ]))[@res.namedArgLoc ][@res.braces ])
~children:[] ())
[@JSX ])
let _ =
@@ -340,37 +340,37 @@ let _ =
fun lineBreak ->
fun identifier ->
((doStuff foo bar baz; bar lineBreak identifier)
- [@res.braces ]))[@ns.namedArgLoc ][@res.braces ])
+ [@res.braces ]))[@res.namedArgLoc ][@res.braces ])
~children:[] ())
[@JSX ])
let _ =
((AttrDiv.createElement ~onClick:((fun event -> handleChange event)
- [@ns.namedArgLoc ][@res.braces ][@bar ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ][@bar ]) ~children:[] ())
[@JSX ])
let _ =
((AttrDiv.createElement
~onClick:((fun eventLongIdentifier -> handleChange eventLongIdentifier)
- [@ns.namedArgLoc ][@res.braces ][@bar ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ][@bar ]) ~children:[] ())
[@JSX ])
let _ =
((StaticDivNamed.createElement
- ~onClick:((fun ~foo:((foo)[@ns.namedArgLoc ]) ->
- fun ~bar:((bar)[@ns.namedArgLoc ]) ->
- fun ~baz:((baz)[@ns.namedArgLoc ]) ->
- fun ~lineBreak:((lineBreak)[@ns.namedArgLoc ]) ->
- fun ~identifier:((identifier)[@ns.namedArgLoc ]) ->
+ ~onClick:((fun ~foo:((foo)[@res.namedArgLoc ]) ->
+ fun ~bar:((bar)[@res.namedArgLoc ]) ->
+ fun ~baz:((baz)[@res.namedArgLoc ]) ->
+ fun ~lineBreak:((lineBreak)[@res.namedArgLoc ]) ->
+ fun ~identifier:((identifier)[@res.namedArgLoc ]) ->
fun () -> bar lineBreak identifier)
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div ~onClick:((fun e -> (((doStuff (); bar foo)[@res.braces ]) : event))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div
~onClick:((fun e ->
fun e2 -> (((doStuff (); bar foo)[@res.braces ]) : event))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div
@@ -381,7 +381,7 @@ let _ =
fun breakLine -> (((doStuff (); bar foo)
[@res.braces ]) : (event * event2 * event3 *
event4 * event5)))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div
@@ -392,7 +392,7 @@ let _ =
fun breakLine ->
(doStuff () : (event * event2 * event3 * event4 *
event5)))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
((div
@@ -404,122 +404,125 @@ let _ =
let _ =
((div
~style:((ReactDOMRe.Style.make ~width:(({js|20px|js})
- [@ns.namedArgLoc ]) ~height:(({js|20px|js})
- [@ns.namedArgLoc ]) ~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ]) ~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))[@ns.namedArgLoc ][@res.braces ]
- [@foo ]) ~children:[] ())
+ [@res.namedArgLoc ]) ~height:(({js|20px|js})
+ [@res.namedArgLoc ]) ~borderRadius:(({js|100%|js})
+ [@res.namedArgLoc ]) ~backgroundColor:(({js|red|js})
+ [@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ][@foo ]) ~children:[] ())
[@JSX ])
let _ =
- ((Animated.createElement ~initialValue:((0.0)[@ns.namedArgLoc ])
- ~value:((value)[@ns.namedArgLoc ])
+ ((Animated.createElement ~initialValue:((0.0)[@res.namedArgLoc ])
+ ~value:((value)[@res.namedArgLoc ])
~children:((ReactDOMRe.Style.make ~width:(({js|20px|js})
- [@ns.namedArgLoc ]) ~height:(({js|20px|js})
- [@ns.namedArgLoc ]) ~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ]) ~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))[@res.braces ]) ())
+ [@res.namedArgLoc ]) ~height:(({js|20px|js})
+ [@res.namedArgLoc ]) ~borderRadius:(({js|100%|js})
+ [@res.namedArgLoc ]) ~backgroundColor:(({js|red|js})
+ [@res.namedArgLoc ]))[@res.braces ]) ())
[@JSX ])
let _ =
- ((Animated.createElement ~initialValue:((0.0)[@ns.namedArgLoc ])
- ~value:((value)[@ns.namedArgLoc ])
+ ((Animated.createElement ~initialValue:((0.0)[@res.namedArgLoc ])
+ ~value:((value)[@res.namedArgLoc ])
~children:((fun value ->
((div
~style:((ReactDOMRe.Style.make ~width:(({js|20px|js})
- [@ns.namedArgLoc ])
- ~height:(({js|20px|js})[@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
+ ~height:(({js|20px|js})
+ [@res.namedArgLoc ])
~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ]))[@res.braces ]) ())
[@JSX ])
let _ =
- ((Animated.createElement ~initialValue:((0.0)[@ns.namedArgLoc ])
- ~value:((value)[@ns.namedArgLoc ])
+ ((Animated.createElement ~initialValue:((0.0)[@res.namedArgLoc ])
+ ~value:((value)[@res.namedArgLoc ])
~children:((fun value ->
(((div
~style:((ReactDOMRe.Style.make
- ~width:(({js|20px|js})[@ns.namedArgLoc ])
+ ~width:(({js|20px|js})
+ [@res.namedArgLoc ])
~height:(({js|20px|js})
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ]) : ReasonReact.element))[@res.braces ]) ())
[@JSX ])
let _ =
- ((Animated.createElement ~initialValue:((0.0)[@ns.namedArgLoc ])
- ~value:((value)[@ns.namedArgLoc ])
+ ((Animated.createElement ~initialValue:((0.0)[@res.namedArgLoc ])
+ ~value:((value)[@res.namedArgLoc ])
~children:((fun value ->
((div
~style:((ReactDOMRe.Style.make ~width:(({js|20px|js})
- [@ns.namedArgLoc ])
- ~height:(({js|20px|js})[@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
+ ~height:(({js|20px|js})
+ [@res.namedArgLoc ])
~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@res.braces ][@JSX ]))[@res.braces ][@foo ]) ())
[@JSX ])
let _ =
- ((Animated.createElement ~initialValue:((0.0)[@ns.namedArgLoc ])
- ~value:((value)[@ns.namedArgLoc ])
+ ((Animated.createElement ~initialValue:((0.0)[@res.namedArgLoc ])
+ ~value:((value)[@res.namedArgLoc ])
~children:((fun value ->
((let width = {js|20px|js} in
let height = {js|20px|js} in
((div
~style:((ReactDOMRe.Style.make ~width:((width)
- [@ns.namedArgLoc ]) ~height:((height)
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ]) ~height:((height)
+ [@res.namedArgLoc ])
~borderRadius:(({js|100%|js})
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~backgroundColor:(({js|red|js})
- [@ns.namedArgLoc ]))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ]))
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ]))
[@res.braces ]))[@res.braces ]) ())
[@JSX ])
let _ =
((div ~callback:((reduce (fun () -> not state))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
- ((button ?id:((id)[@ns.namedArgLoc ])
+ ((button ?id:((id)[@res.namedArgLoc ])
~className:((Cn.make [|{js|button|js};{js|is-fullwidth|js}|])
- [@ns.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
- [@ns.namedArgLoc ]) ~children:[(({js|Submit|js} |> ste)[@res.braces ])]
- ())
+ [@res.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
+ [@res.namedArgLoc ])
+ ~children:[(({js|Submit|js} |> ste)[@res.braces ])] ())
[@JSX ])
let _ =
- ((button ?id:((id)[@ns.namedArgLoc ])
+ ((button ?id:((id)[@res.namedArgLoc ])
~className:((Cn.make [{js|button|js}; {js|is-fullwidth|js}])
- [@ns.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
- [@ns.namedArgLoc ]) ~children:[(({js|Submit|js} |> ste)[@res.braces ])]
- ())
+ [@res.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
+ [@res.namedArgLoc ])
+ ~children:[(({js|Submit|js} |> ste)[@res.braces ])] ())
[@JSX ])
let _ =
- ((button ?id:((id)[@ns.namedArgLoc ])
+ ((button ?id:((id)[@res.namedArgLoc ])
~className:((Cn.make ({js|button|js}, {js|is-fullwidth|js}))
- [@ns.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
- [@ns.namedArgLoc ]) ~children:[(({js|Submit|js} |> ste)[@res.braces ])]
- ())
+ [@res.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
+ [@res.namedArgLoc ])
+ ~children:[(({js|Submit|js} |> ste)[@res.braces ])] ())
[@JSX ])
let _ =
- ((button ?id:((id)[@ns.namedArgLoc ]) ~className:((Cn.make { a = b })
- [@ns.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
- [@ns.namedArgLoc ]) ~children:[(({js|Submit|js} |> ste)[@res.braces ])]
- ())
+ ((button ?id:((id)[@res.namedArgLoc ]) ~className:((Cn.make { a = b })
+ [@res.namedArgLoc ][@res.braces ]) ~onClick:((onClick)
+ [@res.namedArgLoc ])
+ ~children:[(({js|Submit|js} |> ste)[@res.braces ])] ())
[@JSX ])
let _ =
((X.createElement ~y:((z |. (Belt.Option.getWithDefault {js||js}))
- [@ns.namedArgLoc ][@res.braces ]) ~children:[] ())
+ [@res.namedArgLoc ][@res.braces ]) ~children:[] ())
[@JSX ])
let _ =
- ((div ~style:((getStyle ())[@ns.namedArgLoc ][@res.braces ])
+ ((div ~style:((getStyle ())[@res.namedArgLoc ][@res.braces ])
~children:[((ReasonReact.string {js|BugTest|js})[@res.braces ])] ())
[@JSX ])
let _ =
@@ -532,11 +535,11 @@ let _ =
[@JSX ])
let _ =
((View.createElement ~style:((styles#backgroundImageWrapper)
- [@ns.namedArgLoc ])
+ [@res.namedArgLoc ])
~children:[(((let uri = {js|/images/header-background.png|js} in
((Image.createElement ~resizeMode:((Contain)
- [@ns.namedArgLoc ]) ~style:((styles#backgroundImage)
- [@ns.namedArgLoc ]) ~uri:((uri)[@ns.namedArgLoc ])
+ [@res.namedArgLoc ]) ~style:((styles#backgroundImage)
+ [@res.namedArgLoc ]) ~uri:((uri)[@res.namedArgLoc ])
~children:[] ())
[@JSX ])))
[@res.braces ])] ())
@@ -549,9 +552,9 @@ let _ =
(fun possibleGradeValue ->
((option
~key:((possibleGradeValue |> string_of_int)
- [@ns.namedArgLoc ][@res.braces ])
+ [@res.namedArgLoc ][@res.braces ])
~value:((possibleGradeValue |> string_of_int)
- [@ns.namedArgLoc ][@res.braces ])
+ [@res.namedArgLoc ][@res.braces ])
~children:[(((possibleGradeValue |>
string_of_int)
|> str)
@@ -566,7 +569,7 @@ let _ =
[@JSX ])] ())[@JSX ])
;;((div
~children:[((div ~onClick:((fun _ -> Js.log (a <= 10))
- [@ns.namedArgLoc ][@res.braces ])
+ [@res.namedArgLoc ][@res.braces ])
~children:[((div
~children:[((Js.log (a <= 10))
[@res.braces ])] ())
@@ -583,6 +586,6 @@ let _ =
;;(([[|a|]])[@JSX ])
;;(([(1, 2)])[@JSX ])
let _ =
- ((A.createElement ~x:(({js|y|js})[@ns.namedArgLoc ]) ~_spreadProps:((str)
- [@ns.namedArgLoc ]) ~children:[] ())
+ ((A.createElement ~x:(({js|y|js})[@res.namedArgLoc ]) ~_spreadProps:((str)
+ [@res.namedArgLoc ]) ~children:[] ())
[@JSX ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/parenthesized.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/parenthesized.res.txt
index 587797edfaf..4b873ec64c4 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/parenthesized.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/parenthesized.res.txt
@@ -18,7 +18,7 @@ let blockExpression = ((let a = 1 in let b = 2 in a + b)[@res.braces ])
let assertSmthing = assert true
let lazyThing = lazy true
let jsx =
- ((div ~className:(({js|cx|js})[@ns.namedArgLoc ]) ~children:[foo] ())
+ ((div ~className:(({js|cx|js})[@res.namedArgLoc ]) ~children:[foo] ())
[@JSX ])
let ifExpr = if true then Js.log true else Js.log false
let forExpr = for p = 0 to 10 do () done
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/primary.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/primary.res.txt
index f05bcf56700..f7aabdd0018 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/primary.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/primary.res.txt
@@ -18,15 +18,15 @@ let x = (arr.((x : int))).((y : int))
;;f (x : int)
;;f a b c
;;f a b c
-;;f ~a:((a)[@ns.namedArgLoc ]) ~b:((bArg)[@ns.namedArgLoc ]) ?c:((c)
- [@ns.namedArgLoc ]) ?d:((expr)[@ns.namedArgLoc ])
-;;((f ~a:((a)[@ns.namedArgLoc ]) ~b:((bArg)[@ns.namedArgLoc ]) ?c:((c)
- [@ns.namedArgLoc ]) ?d:((expr)[@ns.namedArgLoc ])) ~a:((a)
- [@ns.namedArgLoc ]) ~b:((bArg)[@ns.namedArgLoc ]) ?c:((c)
- [@ns.namedArgLoc ]) ?d:((expr)[@ns.namedArgLoc ])) ~a:((a)
- [@ns.namedArgLoc ]) ~b:((bArg)[@ns.namedArgLoc ]) ?c:((c)
- [@ns.namedArgLoc ]) ?d:((expr)[@ns.namedArgLoc ])
-;;f ~a:(((x : int))[@ns.namedArgLoc ]) ?b:(((y : int))[@ns.namedArgLoc ])
+;;f ~a:((a)[@res.namedArgLoc ]) ~b:((bArg)[@res.namedArgLoc ]) ?c:((c)
+ [@res.namedArgLoc ]) ?d:((expr)[@res.namedArgLoc ])
+;;((f ~a:((a)[@res.namedArgLoc ]) ~b:((bArg)[@res.namedArgLoc ]) ?c:((c)
+ [@res.namedArgLoc ]) ?d:((expr)[@res.namedArgLoc ])) ~a:((a)
+ [@res.namedArgLoc ]) ~b:((bArg)[@res.namedArgLoc ]) ?c:((c)
+ [@res.namedArgLoc ]) ?d:((expr)[@res.namedArgLoc ])) ~a:((a)
+ [@res.namedArgLoc ]) ~b:((bArg)[@res.namedArgLoc ]) ?c:((c)
+ [@res.namedArgLoc ]) ?d:((expr)[@res.namedArgLoc ])
+;;f ~a:(((x : int))[@res.namedArgLoc ]) ?b:(((y : int))[@res.namedArgLoc ])
;;connection#platformId
;;((connection#left)#account)#accountName
;;john#age #= 99
diff --git a/res_syntax/tests/parsing/grammar/expressions/expected/underscoreApply.res.txt b/res_syntax/tests/parsing/grammar/expressions/expected/underscoreApply.res.txt
index e361c9069e4..dc26968f691 100644
--- a/res_syntax/tests/parsing/grammar/expressions/expected/underscoreApply.res.txt
+++ b/res_syntax/tests/parsing/grammar/expressions/expected/underscoreApply.res.txt
@@ -4,10 +4,10 @@ let l =
let l = (fun i -> i + 1) |. (fun __x -> List.map __x [1; 2; 3])
let x __x = List.length __x
let nested x __x = List.length __x
-let incr ~v:((v)[@ns.namedArgLoc ]) = v + 1
+let incr ~v:((v)[@res.namedArgLoc ]) = v + 1
let l1 = ([1; 2; 3] |> (List.map (fun __x -> incr ~v:__x))) |> List.length
let l2 = ([1; 2; 3] |> (List.map (fun __x -> incr ~v:__x))) |> List.length
-let optParam ?v:((v)[@ns.namedArgLoc ]) () = ((if v = None then 0 else 1)
+let optParam ?v:((v)[@res.namedArgLoc ]) () = ((if v = None then 0 else 1)
[@res.ternary ])
let l1 =
([Some 1; None; Some 2] |> (List.map (fun __x -> optParam ?v:__x ()))) |>
diff --git a/res_syntax/tests/parsing/grammar/pattern/expected/firstClassModules.res.txt b/res_syntax/tests/parsing/grammar/pattern/expected/firstClassModules.res.txt
index abb4d16fbd1..f09c04444b7 100644
--- a/res_syntax/tests/parsing/grammar/pattern/expected/firstClassModules.res.txt
+++ b/res_syntax/tests/parsing/grammar/pattern/expected/firstClassModules.res.txt
@@ -4,7 +4,7 @@ let sort (type s)
((module Set) : (module Set.S with type elt = s and type elt2 = t)) l = ()
let foo (module Foo) baz = Foo.bar baz
let bump_list (type a) ((module B) : (module Bumpable with type t = a))
- (l : a list) = List.map ~f:((B.bump l)[@ns.namedArgLoc ])
+ (l : a list) = List.map ~f:((B.bump l)[@res.namedArgLoc ])
;;match x with
| (module Set) -> ()
| ((module Set) : (module Set.S with type elt = s)) -> ()
diff --git a/res_syntax/tests/parsing/grammar/signature/expected/external.res.txt b/res_syntax/tests/parsing/grammar/signature/expected/external.res.txt
index d1e5b7c1949..5cba38efd69 100644
--- a/res_syntax/tests/parsing/grammar/signature/expected/external.res.txt
+++ b/res_syntax/tests/parsing/grammar/signature/expected/external.res.txt
@@ -2,8 +2,8 @@ module type Signature =
sig
type nonrec t
external linkProgram :
- t -> program:((webGlProgram)[@ns.namedArgLoc ]) -> unit = "linkProgram"
- [@@bs.send ]
+ t -> program:((webGlProgram)[@res.namedArgLoc ]) -> unit =
+ "linkProgram"[@@bs.send ]
external add_nat : nat -> int -> int -> int = "add_nat_bytecode"
external svg : unit -> React.element = "svg"
external svg : unit -> React.element = "svg"
diff --git a/res_syntax/tests/parsing/grammar/structure/expected/externalDefinition.res.txt b/res_syntax/tests/parsing/grammar/structure/expected/externalDefinition.res.txt
index 2fc3d2baffa..7c1103079c0 100644
--- a/res_syntax/tests/parsing/grammar/structure/expected/externalDefinition.res.txt
+++ b/res_syntax/tests/parsing/grammar/structure/expected/externalDefinition.res.txt
@@ -2,8 +2,8 @@ external clear : t -> int -> unit = "clear"
external add_nat : nat -> int = "add_nat_bytecode"
external attachShader :
t ->
- program:((webGlProgram)[@ns.namedArgLoc ]) ->
- shader:((webGlShader)[@ns.namedArgLoc ]) -> unit = "attachShader"
+ program:((webGlProgram)[@res.namedArgLoc ]) ->
+ shader:((webGlShader)[@res.namedArgLoc ]) -> unit = "attachShader"
[@@bs.send ]
external svg : unit -> React.element = "svg"
external svg : unit -> React.element = "svg"
diff --git a/res_syntax/tests/parsing/grammar/typedefinition/expected/privateTypeEquation.res.txt b/res_syntax/tests/parsing/grammar/typedefinition/expected/privateTypeEquation.res.txt
index 029b6a13978..388fc21c921 100644
--- a/res_syntax/tests/parsing/grammar/typedefinition/expected/privateTypeEquation.res.txt
+++ b/res_syntax/tests/parsing/grammar/typedefinition/expected/privateTypeEquation.res.txt
@@ -6,7 +6,7 @@ type nonrec t = private int -> int
type nonrec t = private int -> int
type nonrec t = private int -> int -> int
type nonrec t = private
- int -> x:((string)[@ns.namedArgLoc ]) -> float -> unit
+ int -> x:((string)[@res.namedArgLoc ]) -> float -> unit
type nonrec t = private string as 'x
type nonrec t = private [%ext ]
type nonrec t = private [%ext {js|console.log|js}]
diff --git a/res_syntax/tests/parsing/grammar/typexpr/expected/es6Arrow.res.txt b/res_syntax/tests/parsing/grammar/typexpr/expected/es6Arrow.res.txt
index abd3760e6b1..f3f3b4b2375 100644
--- a/res_syntax/tests/parsing/grammar/typexpr/expected/es6Arrow.res.txt
+++ b/res_syntax/tests/parsing/grammar/typexpr/expected/es6Arrow.res.txt
@@ -2,45 +2,45 @@ type nonrec t = x -> unit
type nonrec t = x -> unit
type nonrec t = int -> string -> unit
type nonrec t =
- a:((int)[@ns.namedArgLoc ]) -> b:((int)[@ns.namedArgLoc ]) -> int
+ a:((int)[@res.namedArgLoc ]) -> b:((int)[@res.namedArgLoc ]) -> int
type nonrec t =
- ?a:((int)[@ns.namedArgLoc ]) -> ?b:((int)[@ns.namedArgLoc ]) -> int
+ ?a:((int)[@res.namedArgLoc ]) -> ?b:((int)[@res.namedArgLoc ]) -> int
type nonrec t = int -> int -> int -> int
type nonrec t =
- a:((int)[@ns.namedArgLoc ]) ->
- b:((int)[@ns.namedArgLoc ]) -> c:((int)[@ns.namedArgLoc ]) -> int
+ a:((int)[@res.namedArgLoc ]) ->
+ b:((int)[@res.namedArgLoc ]) -> c:((int)[@res.namedArgLoc ]) -> int
let (f : x -> unit) = xf
let (f : x -> unit) = xf
let (f : int -> string -> unit) = xf
-let (t : a:((int)[@ns.namedArgLoc ]) -> b:((int)[@ns.namedArgLoc ]) -> int) =
- xf
-let (t : ?a:((int)[@ns.namedArgLoc ]) -> ?b:((int)[@ns.namedArgLoc ]) -> int)
+let (t : a:((int)[@res.namedArgLoc ]) -> b:((int)[@res.namedArgLoc ]) -> int)
= xf
+let (t :
+ ?a:((int)[@res.namedArgLoc ]) -> ?b:((int)[@res.namedArgLoc ]) -> int) = xf
let (t : int -> int -> int -> int) = xf
let (t :
- a:((int)[@ns.namedArgLoc ]) ->
- b:((int)[@ns.namedArgLoc ]) -> c:((int)[@ns.namedArgLoc ]) -> int)
+ a:((int)[@res.namedArgLoc ]) ->
+ b:((int)[@res.namedArgLoc ]) -> c:((int)[@res.namedArgLoc ]) -> int)
= xf
-type nonrec t = f:((int)[@ns.namedArgLoc ]) -> string
-type nonrec t = ?f:((int)[@ns.namedArgLoc ]) -> string
-let (f : f:((int)[@ns.namedArgLoc ]) -> string) = fx
-let (f : ?f:((int)[@ns.namedArgLoc ]) -> string) = fx
-type nonrec t = f:((int)[@ns.namedArgLoc ]) -> string
-type nonrec t = f:((int)[@ns.namedArgLoc ]) -> string
-type nonrec t = f:((int -> string)[@ns.namedArgLoc ]) -> float
-type nonrec t = f:((int -> string)[@ns.namedArgLoc ]) -> float
-type nonrec t = f:((int)[@ns.namedArgLoc ]) -> string -> float
+type nonrec t = f:((int)[@res.namedArgLoc ]) -> string
+type nonrec t = ?f:((int)[@res.namedArgLoc ]) -> string
+let (f : f:((int)[@res.namedArgLoc ]) -> string) = fx
+let (f : ?f:((int)[@res.namedArgLoc ]) -> string) = fx
+type nonrec t = f:((int)[@res.namedArgLoc ]) -> string
+type nonrec t = f:((int)[@res.namedArgLoc ]) -> string
+type nonrec t = f:((int -> string)[@res.namedArgLoc ]) -> float
+type nonrec t = f:((int -> string)[@res.namedArgLoc ]) -> float
+type nonrec t = f:((int)[@res.namedArgLoc ]) -> string -> float
type nonrec t =
- ((a:((int)[@ns.namedArgLoc ]) ->
- ((b:((int)[@ns.namedArgLoc ]) -> ((float)[@attr ]) -> unit)[@attrBeforeLblB
- ]))
+ ((a:((int)[@res.namedArgLoc ]) ->
+ ((b:((int)[@res.namedArgLoc ]) -> ((float)[@attr ]) -> unit)[@attrBeforeLblB
+ ]))
[@attrBeforeLblA ])
type nonrec t =
- ((a:((int)[@ns.namedArgLoc ]) ->
- ((b:((int)[@ns.namedArgLoc ]) -> ((float)[@attr ]) -> unit)[@attrBeforeLblB
- ]))
+ ((a:((int)[@res.namedArgLoc ]) ->
+ ((b:((int)[@res.namedArgLoc ]) -> ((float)[@attr ]) -> unit)[@attrBeforeLblB
+ ]))
[@attrBeforeLblA ])
-type nonrec t = ((a:((int)[@ns.namedArgLoc ]) -> unit)[@attr ])
+type nonrec t = ((a:((int)[@res.namedArgLoc ]) -> unit)[@attr ])
type nonrec 'a getInitialPropsFn =
< query: string Js.Dict.t ;req: 'a Js.t Js.Nullable.t > ->
'a Js.t Js.Promise.t
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/grammar/typexpr/expected/objectTypeSpreading.res.txt b/res_syntax/tests/parsing/grammar/typexpr/expected/objectTypeSpreading.res.txt
index 87effd6005a..32c553f3bbf 100644
--- a/res_syntax/tests/parsing/grammar/typexpr/expected/objectTypeSpreading.res.txt
+++ b/res_syntax/tests/parsing/grammar/typexpr/expected/objectTypeSpreading.res.txt
@@ -15,11 +15,11 @@ let steve =
((([%obj { name = {js|Steve|js}; age = 30 }] : < user ;age: int > ))
[@res.braces ])
let printFullUser (steve : < user ;age: int > ) = Js.log steve
-let printFullUser ~user:(((user : < user ;age: int > ))[@ns.namedArgLoc ])
- = Js.log steve
-let printFullUser ~user:(((user : < user ;age: int > ))[@ns.namedArgLoc ])
- = Js.log steve
-let printFullUser ?user:(((user)[@ns.namedArgLoc ])=
+let printFullUser ~user:(((user : < user ;age: int > ))[@res.namedArgLoc ])
+ = Js.log steve
+let printFullUser ~user:(((user : < user ;age: int > ))[@res.namedArgLoc ])
+ = Js.log steve
+let printFullUser ?user:(((user)[@res.namedArgLoc ])=
(steve : < user ;age: int > )) = Js.log steve
external steve : < user ;age: int > = "steve"[@@val ]
let makeCeoOf30yearsOld name =
diff --git a/res_syntax/tests/parsing/grammar/typexpr/expected/parenthesized.res.txt b/res_syntax/tests/parsing/grammar/typexpr/expected/parenthesized.res.txt
index f6e649116d7..4fc6efd381d 100644
--- a/res_syntax/tests/parsing/grammar/typexpr/expected/parenthesized.res.txt
+++ b/res_syntax/tests/parsing/grammar/typexpr/expected/parenthesized.res.txt
@@ -1 +1 @@
-type nonrec t = ((a:((int)[@ns.namedArgLoc ]) -> unit)[@attr ])
\ No newline at end of file
+type nonrec t = ((a:((int)[@res.namedArgLoc ]) -> unit)[@attr ])
\ No newline at end of file
diff --git a/res_syntax/tests/parsing/infiniteLoops/expected/nonRecTypes.res.txt b/res_syntax/tests/parsing/infiniteLoops/expected/nonRecTypes.res.txt
index 13791abe374..1db620ae15d 100644
--- a/res_syntax/tests/parsing/infiniteLoops/expected/nonRecTypes.res.txt
+++ b/res_syntax/tests/parsing/infiniteLoops/expected/nonRecTypes.res.txt
@@ -146,8 +146,8 @@ include
| None ->
let leaf =
createNode ~value:((Js.Internal.raw_expr {js|0|js})
- [@ns.namedArgLoc ]) ~color:((Black)[@ns.namedArgLoc ])
- ~height:((0.)[@ns.namedArgLoc ]) in
+ [@res.namedArgLoc ]) ~color:((Black)[@res.namedArgLoc ])
+ ~height:((0.)[@res.namedArgLoc ]) in
let isLeaf = Js.Internal.fn_mk1 (fun x -> x == leaf) in
(leaf, isLeaf)
| Some successor ->
@@ -157,7 +157,7 @@ include
(match nodeParent with
| None -> ()
| Some parent ->
- leftOrRightSet parent ~node:((nodeToRemove)[@ns.namedArgLoc ])
+ leftOrRightSet parent ~node:((nodeToRemove)[@res.namedArgLoc ])
(Some successor));
updateSumRecursive rbt successor;
if (colorGet nodeToRemove) == Black
@@ -281,7 +281,7 @@ include
(match parentGet successor with
| None -> ()
| Some parent ->
- leftOrRightSet parent ~node:((successor)[@ns.namedArgLoc ])
+ leftOrRightSet parent ~node:((successor)[@res.namedArgLoc ])
None)))
[@res.braces ])
let remove rbt value =
@@ -307,9 +307,9 @@ include
| None -> None
| Some node -> Some (valueGet node))
[@res.braces ])
- let make ~compare:((compare)[@ns.namedArgLoc ]) =
- t ~size:((0)[@ns.namedArgLoc ]) ~root:((None)[@ns.namedArgLoc ])
- ~compare:((compare)[@ns.namedArgLoc ])
+ let make ~compare:((compare)[@res.namedArgLoc ]) =
+ t ~size:((0)[@res.namedArgLoc ]) ~root:((None)[@res.namedArgLoc ])
+ ~compare:((compare)[@res.namedArgLoc ])
let rec heightOfInterval rbt node lhs rhs =
match node with
| None -> 0.
@@ -359,7 +359,7 @@ include
match firstVisibleNode node offset with
| None -> maxNode node
| first -> first
- let firstVisible rbt ~offset:((offset)[@ns.namedArgLoc ]) =
+ let firstVisible rbt ~offset:((offset)[@res.namedArgLoc ]) =
match firstVisibleNode (rootGet rbt) offset with
| None -> None
| Some node -> Some (valueGet node)
@@ -375,7 +375,7 @@ include
| None -> firstRightParent node
| Some right -> Some (leftmost right)
let rec sumLeftSpine node
- ~fromRightChild:((fromRightChild)[@ns.namedArgLoc ]) =
+ ~fromRightChild:((fromRightChild)[@res.namedArgLoc ]) =
((let leftSpine =
match leftGet node with
| None -> heightGet node
@@ -389,10 +389,10 @@ include
leftSpine +.
(sumLeftSpine parent
~fromRightChild:(((rightGet parent) == (Some node))
- [@ns.namedArgLoc ])))
+ [@res.namedArgLoc ])))
[@res.braces ])
let getY node =
- (sumLeftSpine node ~fromRightChild:((true)[@ns.namedArgLoc ])) -.
+ (sumLeftSpine node ~fromRightChild:((true)[@res.namedArgLoc ])) -.
(heightGet node)
let linearSearch rbt callback =
((let rec find node callback =
@@ -406,8 +406,8 @@ include
| None -> None
| Some node -> find node callback)
[@res.braces ])
- let rec iterate ~inclusive:((inclusive)[@ns.namedArgLoc ]) firstNode
- lastNode ~callback:((callback)[@ns.namedArgLoc ]) =
+ let rec iterate ~inclusive:((inclusive)[@res.namedArgLoc ]) firstNode
+ lastNode ~callback:((callback)[@res.namedArgLoc ]) =
match firstNode with
| None -> ()
| Some node ->
@@ -415,12 +415,12 @@ include
if firstNode != lastNode
then
(if not inclusive then Js.Internal.fn_run1 callback node;
- iterate ~inclusive:((inclusive)[@ns.namedArgLoc ])
+ iterate ~inclusive:((inclusive)[@res.namedArgLoc ])
(nextNode node) lastNode ~callback:((callback)
- [@ns.namedArgLoc ])))
- let rec iterateWithY ?y:((y)[@ns.namedArgLoc ])
- ~inclusive:((inclusive)[@ns.namedArgLoc ]) firstNode lastNode
- ~callback:((callback)[@ns.namedArgLoc ]) =
+ [@res.namedArgLoc ])))
+ let rec iterateWithY ?y:((y)[@res.namedArgLoc ])
+ ~inclusive:((inclusive)[@res.namedArgLoc ]) firstNode lastNode
+ ~callback:((callback)[@res.namedArgLoc ]) =
match firstNode with
| None -> ()
| Some node ->
@@ -429,22 +429,22 @@ include
if firstNode != lastNode
then
(if not inclusive then Js.Internal.fn_run2 callback node y;
- iterateWithY ~y:((y +. (heightGet node))[@ns.namedArgLoc ])
- ~inclusive:((inclusive)[@ns.namedArgLoc ]) (nextNode node)
- lastNode ~callback:((callback)[@ns.namedArgLoc ])))
- let rec updateSum node ~delta:((delta)[@ns.namedArgLoc ]) =
+ iterateWithY ~y:((y +. (heightGet node))[@res.namedArgLoc ])
+ ~inclusive:((inclusive)[@res.namedArgLoc ]) (nextNode node)
+ lastNode ~callback:((callback)[@res.namedArgLoc ])))
+ let rec updateSum node ~delta:((delta)[@res.namedArgLoc ]) =
match node with
| None -> ()
| Some node ->
(sumSet node ((sumGet node) +. delta);
- updateSum (parentGet node) ~delta:((delta)[@ns.namedArgLoc ]))
- let setHeight rbt value ~height:((height)[@ns.namedArgLoc ]) =
+ updateSum (parentGet node) ~delta:((delta)[@res.namedArgLoc ]))
+ let setHeight rbt value ~height:((height)[@res.namedArgLoc ]) =
match _findNode rbt (rootGet rbt) value with
| None -> ()
| Some node ->
let delta = height -. (heightGet node) in
(heightSet node height;
- updateSum (Some node) ~delta:((delta)[@ns.namedArgLoc ]))
+ updateSum (Some node) ~delta:((delta)[@res.namedArgLoc ]))
type nonrec 'value oldNewVisibleNodes =
{
mutable old: 'value array ;