Skip to content

Commit 8321081

Browse files
committed
Rename ns.namedArgLoc to res.namedArgLoc
1 parent b447583 commit 8321081

34 files changed

+424
-415
lines changed

lib/4.06.1/unstable/js_compiler.ml

+20-20
Original file line numberDiff line numberDiff line change
@@ -49873,9 +49873,9 @@ let filterParsingAttrs attrs =
4987349873
match attr with
4987449874
| ( {
4987549875
Location.txt =
49876-
( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
49877-
| "res.optional" | "res.ternary" | "res.async" | "res.await"
49878-
| "res.template" );
49876+
( "bs" | "res.uapp" | "res.braces" | "res.iflet"
49877+
| "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
49878+
| "res.await" | "res.template" );
4987949879
},
4988049880
_ ) ->
4988149881
false
@@ -50723,7 +50723,7 @@ let getLoc node =
5072350723
| CoreType ct -> ct.ptyp_loc
5072450724
| ExprArgument expr -> (
5072550725
match expr.Parsetree.pexp_attributes with
50726-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
50726+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5072750727
{loc with loc_end = expr.pexp_loc.loc_end}
5072850728
| _ -> expr.pexp_loc)
5072950729
| Expression e -> (
@@ -51731,7 +51731,7 @@ and walkExpression expr t comments =
5173151731
let open Parsetree in
5173251732
let startPos =
5173351733
match pattern.ppat_attributes with
51734-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
51734+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5173551735
loc.loc_start
5173651736
| _ -> pattern.ppat_loc.loc_start
5173751737
in
@@ -51790,7 +51790,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
5179051790

5179151791
and walkExprArgument expr t comments =
5179251792
match expr.Parsetree.pexp_attributes with
51793-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
51793+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5179451794
let leading, trailing = partitionLeadingTrailing comments loc in
5179551795
attach t.leading loc leading;
5179651796
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -52198,7 +52198,7 @@ and walkTypeParameters typeParameters t comments =
5219852198
visitListButContinueWithRemainingComments
5219952199
~getLoc:(fun (_, _, typexpr) ->
5220052200
match typexpr.Parsetree.ptyp_attributes with
52201-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
52201+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5220252202
{loc with loc_end = typexpr.ptyp_loc.loc_end}
5220352203
| _ -> typexpr.ptyp_loc)
5220452204
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
@@ -55147,7 +55147,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
5514755147
in
5514855148
let loc, typ =
5514955149
match typ.ptyp_attributes with
55150-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
55150+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5515155151
( {loc with loc_end = typ.ptyp_loc.loc_end},
5515255152
{typ with ptyp_attributes = attrs} )
5515355153
| _ -> (typ.ptyp_loc, typ)
@@ -57433,7 +57433,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
5743357433
] ->
5743457434
let loc =
5743557435
match expr.Parsetree.pexp_attributes with
57436-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
57436+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5743757437
{loc with loc_end = expr.pexp_loc.loc_end}
5743857438
| _ -> expr.pexp_loc
5743957439
in
@@ -57469,7 +57469,7 @@ and printJsxProp ~state arg cmtTbl =
5746957469
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
5747057470
{
5747157471
Parsetree.pexp_attributes =
57472-
[({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
57472+
[({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
5747357473
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
5747457474
} )
5747557475
when lblTxt = ident (* jsx punning *) -> (
@@ -57495,7 +57495,7 @@ and printJsxProp ~state arg cmtTbl =
5749557495
| lbl, expr ->
5749657496
let argLoc, expr =
5749757497
match expr.pexp_attributes with
57498-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
57498+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5749957499
(loc, {expr with pexp_attributes = attrs})
5750057500
| _ -> (Location.none, expr)
5750157501
in
@@ -57792,12 +57792,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5779257792
| ( Asttypes.Labelled lbl,
5779357793
({
5779457794
pexp_desc = Pexp_ident {txt = Longident.Lident name};
57795-
pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
57795+
pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
5779657796
} as argExpr) )
5779757797
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
5779857798
let loc =
5779957799
match arg.pexp_attributes with
57800-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
57800+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
5780157801
| _ -> arg.pexp_loc
5780257802
in
5780357803
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -57811,12 +57811,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5781157811
typ );
5781257812
pexp_loc;
5781357813
pexp_attributes =
57814-
([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
57814+
([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
5781557815
} )
5781657816
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
5781757817
let loc =
5781857818
match attrs with
57819-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
57819+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
5782057820
{loc with loc_end = pexp_loc.loc_end}
5782157821
| _ -> arg.pexp_loc
5782257822
in
@@ -57834,20 +57834,20 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5783457834
| ( Asttypes.Optional lbl,
5783557835
{
5783657836
pexp_desc = Pexp_ident {txt = Longident.Lident name};
57837-
pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
57837+
pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
5783857838
} )
5783957839
when lbl = name ->
5784057840
let loc =
5784157841
match arg.pexp_attributes with
57842-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
57842+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
5784357843
| _ -> arg.pexp_loc
5784457844
in
5784557845
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
5784657846
printComments doc cmtTbl loc
5784757847
| _lbl, expr ->
5784857848
let argLoc, expr =
5784957849
match expr.pexp_attributes with
57850-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
57850+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5785157851
(loc, {expr with pexp_attributes = attrs})
5785257852
| _ -> (expr.pexp_loc, expr)
5785357853
in
@@ -58137,13 +58137,13 @@ and printExpFunParameter ~state parameter cmtTbl =
5813758137
match defaultExpr with
5813858138
| None -> (
5813958139
match pattern.ppat_attributes with
58140-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
58140+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
5814158141
{loc with loc_end = pattern.ppat_loc.loc_end}
5814258142
| _ -> pattern.ppat_loc)
5814358143
| Some expr ->
5814458144
let startPos =
5814558145
match pattern.ppat_attributes with
58146-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
58146+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
5814758147
| _ -> pattern.ppat_loc.loc_start
5814858148
in
5814958149
{

lib/4.06.1/unstable/js_playground_compiler.ml

+28-26
Original file line numberDiff line numberDiff line change
@@ -49873,9 +49873,9 @@ let filterParsingAttrs attrs =
4987349873
match attr with
4987449874
| ( {
4987549875
Location.txt =
49876-
( "bs" | "res.uapp" | "res.braces" | "res.iflet" | "ns.namedArgLoc"
49877-
| "res.optional" | "res.ternary" | "res.async" | "res.await"
49878-
| "res.template" );
49876+
( "bs" | "res.uapp" | "res.braces" | "res.iflet"
49877+
| "res.namedArgLoc" | "res.optional" | "res.ternary" | "res.async"
49878+
| "res.await" | "res.template" );
4987949879
},
4988049880
_ ) ->
4988149881
false
@@ -50723,7 +50723,7 @@ let getLoc node =
5072350723
| CoreType ct -> ct.ptyp_loc
5072450724
| ExprArgument expr -> (
5072550725
match expr.Parsetree.pexp_attributes with
50726-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
50726+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5072750727
{loc with loc_end = expr.pexp_loc.loc_end}
5072850728
| _ -> expr.pexp_loc)
5072950729
| Expression e -> (
@@ -51731,7 +51731,7 @@ and walkExpression expr t comments =
5173151731
let open Parsetree in
5173251732
let startPos =
5173351733
match pattern.ppat_attributes with
51734-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
51734+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5173551735
loc.loc_start
5173651736
| _ -> pattern.ppat_loc.loc_start
5173751737
in
@@ -51790,7 +51790,7 @@ and walkExprPararameter (_attrs, _argLbl, exprOpt, pattern) t comments =
5179051790

5179151791
and walkExprArgument expr t comments =
5179251792
match expr.Parsetree.pexp_attributes with
51793-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
51793+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5179451794
let leading, trailing = partitionLeadingTrailing comments loc in
5179551795
attach t.leading loc leading;
5179651796
let afterLabel, rest = partitionAdjacentTrailing loc trailing in
@@ -52198,7 +52198,7 @@ and walkTypeParameters typeParameters t comments =
5219852198
visitListButContinueWithRemainingComments
5219952199
~getLoc:(fun (_, _, typexpr) ->
5220052200
match typexpr.Parsetree.ptyp_attributes with
52201-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
52201+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5220252202
{loc with loc_end = typexpr.ptyp_loc.loc_end}
5220352203
| _ -> typexpr.ptyp_loc)
5220452204
~walkNode:walkTypeParameter ~newlineDelimited:false typeParameters t
@@ -55147,7 +55147,7 @@ and printTypeParameter ~state (attrs, lbl, typ) cmtTbl =
5514755147
in
5514855148
let loc, typ =
5514955149
match typ.ptyp_attributes with
55150-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
55150+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5515155151
( {loc with loc_end = typ.ptyp_loc.loc_end},
5515255152
{typ with ptyp_attributes = attrs} )
5515355153
| _ -> (typ.ptyp_loc, typ)
@@ -57433,7 +57433,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option =
5743357433
] ->
5743457434
let loc =
5743557435
match expr.Parsetree.pexp_attributes with
57436-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _attrs ->
57436+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _attrs ->
5743757437
{loc with loc_end = expr.pexp_loc.loc_end}
5743857438
| _ -> expr.pexp_loc
5743957439
in
@@ -57469,7 +57469,7 @@ and printJsxProp ~state arg cmtTbl =
5746957469
| ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl),
5747057470
{
5747157471
Parsetree.pexp_attributes =
57472-
[({Location.txt = "ns.namedArgLoc"; loc = argLoc}, _)];
57472+
[({Location.txt = "res.namedArgLoc"; loc = argLoc}, _)];
5747357473
pexp_desc = Pexp_ident {txt = Longident.Lident ident};
5747457474
} )
5747557475
when lblTxt = ident (* jsx punning *) -> (
@@ -57495,7 +57495,7 @@ and printJsxProp ~state arg cmtTbl =
5749557495
| lbl, expr ->
5749657496
let argLoc, expr =
5749757497
match expr.pexp_attributes with
57498-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
57498+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5749957499
(loc, {expr with pexp_attributes = attrs})
5750057500
| _ -> (Location.none, expr)
5750157501
in
@@ -57792,12 +57792,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5779257792
| ( Asttypes.Labelled lbl,
5779357793
({
5779457794
pexp_desc = Pexp_ident {txt = Longident.Lident name};
57795-
pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
57795+
pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
5779657796
} as argExpr) )
5779757797
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
5779857798
let loc =
5779957799
match arg.pexp_attributes with
57800-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
57800+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
5780157801
| _ -> arg.pexp_loc
5780257802
in
5780357803
let doc = Doc.concat [Doc.tilde; printIdentLike lbl] in
@@ -57811,12 +57811,12 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5781157811
typ );
5781257812
pexp_loc;
5781357813
pexp_attributes =
57814-
([] | [({Location.txt = "ns.namedArgLoc"}, _)]) as attrs;
57814+
([] | [({Location.txt = "res.namedArgLoc"}, _)]) as attrs;
5781557815
} )
5781657816
when lbl = name && not (ParsetreeViewer.isBracedExpr argExpr) ->
5781757817
let loc =
5781857818
match attrs with
57819-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
57819+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
5782057820
{loc with loc_end = pexp_loc.loc_end}
5782157821
| _ -> arg.pexp_loc
5782257822
in
@@ -57834,20 +57834,20 @@ and printArgument ~state (argLbl, arg) cmtTbl =
5783457834
| ( Asttypes.Optional lbl,
5783557835
{
5783657836
pexp_desc = Pexp_ident {txt = Longident.Lident name};
57837-
pexp_attributes = [] | [({Location.txt = "ns.namedArgLoc"}, _)];
57837+
pexp_attributes = [] | [({Location.txt = "res.namedArgLoc"}, _)];
5783857838
} )
5783957839
when lbl = name ->
5784057840
let loc =
5784157841
match arg.pexp_attributes with
57842-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc
57842+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc
5784357843
| _ -> arg.pexp_loc
5784457844
in
5784557845
let doc = Doc.concat [Doc.tilde; printIdentLike lbl; Doc.question] in
5784657846
printComments doc cmtTbl loc
5784757847
| _lbl, expr ->
5784857848
let argLoc, expr =
5784957849
match expr.pexp_attributes with
57850-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: attrs ->
57850+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: attrs ->
5785157851
(loc, {expr with pexp_attributes = attrs})
5785257852
| _ -> (expr.pexp_loc, expr)
5785357853
in
@@ -58137,13 +58137,13 @@ and printExpFunParameter ~state parameter cmtTbl =
5813758137
match defaultExpr with
5813858138
| None -> (
5813958139
match pattern.ppat_attributes with
58140-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ ->
58140+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ ->
5814158141
{loc with loc_end = pattern.ppat_loc.loc_end}
5814258142
| _ -> pattern.ppat_loc)
5814358143
| Some expr ->
5814458144
let startPos =
5814558145
match pattern.ppat_attributes with
58146-
| ({Location.txt = "ns.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
58146+
| ({Location.txt = "res.namedArgLoc"; loc}, _) :: _ -> loc.loc_start
5814758147
| _ -> pattern.ppat_loc.loc_start
5814858148
in
5814958149
{
@@ -163640,7 +163640,7 @@ and parseParameter p =
163640163640
Parser.next p;
163641163641
let lblName, loc = parseLident p in
163642163642
let propLocAttr =
163643-
(Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
163643+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
163644163644
in
163645163645
match p.Parser.token with
163646163646
| Comma | Equal | Rparen ->
@@ -164674,7 +164674,7 @@ and parseJsxProp p =
164674164674
let optional = Parser.optional p Question in
164675164675
let name, loc = parseLident p in
164676164676
let propLocAttr =
164677-
(Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
164677+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
164678164678
in
164679164679
(* optional punning: <foo ?a /> *)
164680164680
if optional then
@@ -164713,7 +164713,7 @@ and parseJsxProp p =
164713164713
Parser.next p;
164714164714
let loc = mkLoc p.Parser.startPos p.prevEndPos in
164715164715
let propLocAttr =
164716-
(Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
164716+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
164717164717
in
164718164718
let attrExpr =
164719164719
let e = parsePrimaryExpr ~operand:(parseAtomicExpr p) p in
@@ -165530,7 +165530,7 @@ and parseArgument2 p ~dotted : argument option =
165530165530
let endPos = p.prevEndPos in
165531165531
let loc = mkLoc startPos endPos in
165532165532
let propLocAttr =
165533-
(Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
165533+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
165534165534
in
165535165535
let identExpr =
165536165536
Ast_helper.Exp.ident ~attrs:[propLocAttr] ~loc
@@ -166135,7 +166135,7 @@ and parseTypeParameter p =
166135166135
Parser.next p;
166136166136
let name, loc = parseLident p in
166137166137
let lblLocAttr =
166138-
(Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr [])
166138+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
166139166139
in
166140166140
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
166141166141
let typ =
@@ -166213,7 +166213,9 @@ and parseEs6ArrowType ~attrs p =
166213166213
| Tilde ->
166214166214
Parser.next p;
166215166215
let name, loc = parseLident p in
166216-
let lblLocAttr = (Location.mkloc "ns.namedArgLoc" loc, Parsetree.PStr []) in
166216+
let lblLocAttr =
166217+
(Location.mkloc "res.namedArgLoc" loc, Parsetree.PStr [])
166218+
in
166217166219
Parser.expect ~grammar:Grammar.TypeExpression Colon p;
166218166220
let typ =
166219166221
let typ = parseTypExpr ~alias:false ~es6Arrow:false p in

0 commit comments

Comments
 (0)