Skip to content

Commit 7b22491

Browse files
authored
Sync the latest syntax (#5964)
1 parent 7594bee commit 7b22491

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#### :nail_care: Polish
1616

1717
- Add the gap property to jsxDOMStyle https://github.com/rescript-lang/rescript-compiler/pull/5956
18+
- Fix issue where error messages related to non-existent props were displayed without location information https://github.com/rescript-lang/syntax/pull/730
1819

1920
# 10.1.2
2021

jscomp/napkin/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
- Fix build error where aliasing arguments to `_` in the make function with JSX V4. https://github.com/rescript-lang/syntax/pull/720
5656
- Fix parsing of spread props as an expression in JSX V4 https://github.com/rescript-lang/syntax/pull/721
5757
- Fix dropping attributes from props in make function in JSX V4 https://github.com/rescript-lang/syntax/pull/723
58+
- Fix an issue where error messages related to duplicate props were displayed without a loc and were unclear https://github.com/rescript-lang/syntax/pull/728
59+
- Fix issue where error messages related to non-existent props were displayed without location information https://github.com/rescript-lang/syntax/pull/730
5860

5961
#### :eyeglasses: Spec Compliance
6062

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275129,24 +275129,25 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
275129275129
( Exp.ident {loc = Location.none; txt = Ldot (Lident "React", "jsxs")},
275130275130
[] )
275131275131
in
275132-
Exp.apply ~attrs jsxExpr ([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
275132+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
275133+
([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
275133275134
| _ -> (
275134275135
match (!childrenArg, keyProp) with
275135275136
| None, key :: _ ->
275136-
Exp.apply ~attrs
275137+
Exp.apply ~loc:jsxExprLoc ~attrs
275137275138
(Exp.ident
275138275139
{
275139275140
loc = Location.none;
275140275141
txt = Ldot (Lident "JsxPPXReactSupport", "createElementWithKey");
275141275142
})
275142275143
[key; (nolabel, makeID); (nolabel, props)]
275143275144
| None, [] ->
275144-
Exp.apply ~attrs
275145+
Exp.apply ~loc:jsxExprLoc ~attrs
275145275146
(Exp.ident
275146275147
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
275147275148
[(nolabel, makeID); (nolabel, props)]
275148275149
| Some children, key :: _ ->
275149-
Exp.apply ~attrs
275150+
Exp.apply ~loc:jsxExprLoc ~attrs
275150275151
(Exp.ident
275151275152
{
275152275153
loc = Location.none;
@@ -275155,7 +275156,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
275155275156
})
275156275157
[key; (nolabel, makeID); (nolabel, props); (nolabel, children)]
275157275158
| Some children, [] ->
275158-
Exp.apply ~attrs
275159+
Exp.apply ~loc:jsxExprLoc ~attrs
275159275160
(Exp.ident
275160275161
{
275161275162
loc = Location.none;
@@ -275236,7 +275237,7 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
275236275237
( Exp.ident {loc = Location.none; txt = Ldot (Lident "ReactDOM", "jsxs")},
275237275238
[] )
275238275239
in
275239-
Exp.apply ~attrs jsxExpr
275240+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
275240275241
([(nolabel, componentNameExpr); (nolabel, props)] @ keyAndUnit)
275241275242
| _ ->
275242275243
let children, nonChildrenProps =

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275129,24 +275129,25 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
275129275129
( Exp.ident {loc = Location.none; txt = Ldot (Lident "React", "jsxs")},
275130275130
[] )
275131275131
in
275132-
Exp.apply ~attrs jsxExpr ([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
275132+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
275133+
([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
275133275134
| _ -> (
275134275135
match (!childrenArg, keyProp) with
275135275136
| None, key :: _ ->
275136-
Exp.apply ~attrs
275137+
Exp.apply ~loc:jsxExprLoc ~attrs
275137275138
(Exp.ident
275138275139
{
275139275140
loc = Location.none;
275140275141
txt = Ldot (Lident "JsxPPXReactSupport", "createElementWithKey");
275141275142
})
275142275143
[key; (nolabel, makeID); (nolabel, props)]
275143275144
| None, [] ->
275144-
Exp.apply ~attrs
275145+
Exp.apply ~loc:jsxExprLoc ~attrs
275145275146
(Exp.ident
275146275147
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
275147275148
[(nolabel, makeID); (nolabel, props)]
275148275149
| Some children, key :: _ ->
275149-
Exp.apply ~attrs
275150+
Exp.apply ~loc:jsxExprLoc ~attrs
275150275151
(Exp.ident
275151275152
{
275152275153
loc = Location.none;
@@ -275155,7 +275156,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
275155275156
})
275156275157
[key; (nolabel, makeID); (nolabel, props); (nolabel, children)]
275157275158
| Some children, [] ->
275158-
Exp.apply ~attrs
275159+
Exp.apply ~loc:jsxExprLoc ~attrs
275159275160
(Exp.ident
275160275161
{
275161275162
loc = Location.none;
@@ -275236,7 +275237,7 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
275236275237
( Exp.ident {loc = Location.none; txt = Ldot (Lident "ReactDOM", "jsxs")},
275237275238
[] )
275238275239
in
275239-
Exp.apply ~attrs jsxExpr
275240+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
275240275241
([(nolabel, componentNameExpr); (nolabel, props)] @ keyAndUnit)
275241275242
| _ ->
275242275243
let children, nonChildrenProps =

lib/4.06.1/whole_compiler.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285513,24 +285513,25 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
285513285513
( Exp.ident {loc = Location.none; txt = Ldot (Lident "React", "jsxs")},
285514285514
[] )
285515285515
in
285516-
Exp.apply ~attrs jsxExpr ([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
285516+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
285517+
([(nolabel, makeID); (nolabel, props)] @ keyAndUnit)
285517285518
| _ -> (
285518285519
match (!childrenArg, keyProp) with
285519285520
| None, key :: _ ->
285520-
Exp.apply ~attrs
285521+
Exp.apply ~loc:jsxExprLoc ~attrs
285521285522
(Exp.ident
285522285523
{
285523285524
loc = Location.none;
285524285525
txt = Ldot (Lident "JsxPPXReactSupport", "createElementWithKey");
285525285526
})
285526285527
[key; (nolabel, makeID); (nolabel, props)]
285527285528
| None, [] ->
285528-
Exp.apply ~attrs
285529+
Exp.apply ~loc:jsxExprLoc ~attrs
285529285530
(Exp.ident
285530285531
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
285531285532
[(nolabel, makeID); (nolabel, props)]
285532285533
| Some children, key :: _ ->
285533-
Exp.apply ~attrs
285534+
Exp.apply ~loc:jsxExprLoc ~attrs
285534285535
(Exp.ident
285535285536
{
285536285537
loc = Location.none;
@@ -285539,7 +285540,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
285539285540
})
285540285541
[key; (nolabel, makeID); (nolabel, props); (nolabel, children)]
285541285542
| Some children, [] ->
285542-
Exp.apply ~attrs
285543+
Exp.apply ~loc:jsxExprLoc ~attrs
285543285544
(Exp.ident
285544285545
{
285545285546
loc = Location.none;
@@ -285620,7 +285621,7 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
285620285621
( Exp.ident {loc = Location.none; txt = Ldot (Lident "ReactDOM", "jsxs")},
285621285622
[] )
285622285623
in
285623-
Exp.apply ~attrs jsxExpr
285624+
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
285624285625
([(nolabel, componentNameExpr); (nolabel, props)] @ keyAndUnit)
285625285626
| _ ->
285626285627
let children, nonChildrenProps =

0 commit comments

Comments
 (0)