File tree 5 files changed +105
-1
lines changed
tests/syntax_tests/data/ast-mapping
5 files changed +105
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ done <temp/files.txt
45
45
# printing with ast conversion
46
46
find syntax_tests/data/ast-mapping -name " *.res" -o -name " *.resi" -o -name " *.ml" -o -name " *.mli" > temp/files.txt
47
47
while read file; do
48
- $DUNE_BIN_DIR /res_parser -test-ast-conversion $file & > $( exp $file ) & maybeWait
48
+ $DUNE_BIN_DIR /res_parser -test-ast-conversion -jsx-version 4 -jsx-mode " automatic " $file & > $( exp $file ) & maybeWait
49
49
done < temp/files.txt
50
50
51
51
# printing with ppx
Original file line number Diff line number Diff line change
1
+ let emptyUnary = <input />
2
+
3
+ let emptyNonunary = <div ></div >
4
+
5
+ let emptyUnaryWithAttributes = <input type_ = "text" />
6
+
7
+ let emptyNonunaryWithAttributes = <div className = "container" ></div >
8
+
9
+ let elementWithChildren = <div >
10
+ <h1 >{React .string ("Hi" )}</h1 >
11
+ <p >{React .string ("Hello" )}</p >
12
+ </div >
13
+
14
+ let elementWithChildrenAndAttributes = <div className = "container" >
15
+ <h1 >{React .string ("Hi" )}</h1 >
16
+ <p >{React .string ("Hello" )}</p >
17
+ </div >
18
+
19
+ let elementWithConditionalChildren = <div >
20
+ {if true {
21
+ <h1 >{React .string ("Hi" )}</h1 >
22
+ } else {
23
+ React .null
24
+ }}
25
+ </div >
Original file line number Diff line number Diff line change
1
+ let empty = <></>
2
+
3
+ let fragmentWithBracedExpresssion = <>{React .int (1 + 2 )}</>
4
+
5
+ let fragmentWithJSXElements = <>
6
+ <h1 >{React .string ("Hi" )}</h1 >
7
+ <p >{React .string ("Hello" )}</p >
8
+ </>
9
+
10
+ let nestedFragments = <>
11
+ <h1 >{React .string ("Hi" )}</h1 >
12
+ <p >{React .string ("Hello" )}</p >
13
+ <>{React .string ("Bye" )}</>
14
+ </>
Original file line number Diff line number Diff line change
1
+ let emptyUnary = ReactDOM.jsx("input", {})
2
+
3
+ let emptyNonunary = ReactDOM.jsx("div", {})
4
+
5
+ let emptyUnaryWithAttributes = ReactDOM.jsx("input", {type_: "text"})
6
+
7
+ let emptyNonunaryWithAttributes = ReactDOM.jsx("div", {className: "container"})
8
+
9
+ let elementWithChildren = ReactDOM.jsxs(
10
+ "div",
11
+ {
12
+ children: React.array([
13
+ ReactDOM.jsx("h1", {children: ?ReactDOM.someElement({React.string("Hi")})}),
14
+ ReactDOM.jsx("p", {children: ?ReactDOM.someElement({React.string("Hello")})}),
15
+ ]),
16
+ },
17
+ )
18
+
19
+ let elementWithChildrenAndAttributes = ReactDOM.jsxs(
20
+ "div",
21
+ {
22
+ className: "container",
23
+ children: React.array([
24
+ ReactDOM.jsx("h1", {children: ?ReactDOM.someElement({React.string("Hi")})}),
25
+ ReactDOM.jsx("p", {children: ?ReactDOM.someElement({React.string("Hello")})}),
26
+ ]),
27
+ },
28
+ )
29
+
30
+ let elementWithConditionalChildren = ReactDOM.jsx(
31
+ "div",
32
+ {
33
+ children: ?ReactDOM.someElement({
34
+ if true {
35
+ ReactDOM.jsx("h1", {children: ?ReactDOM.someElement({React.string("Hi")})})
36
+ } else {
37
+ React.null
38
+ }
39
+ }),
40
+ },
41
+ )
Original file line number Diff line number Diff line change
1
+ let empty = React.jsx(React.jsxFragment, {})
2
+
3
+ let fragmentWithBracedExpresssion = React.jsx(React.jsxFragment, {children: {React.int(1 + 2)}})
4
+
5
+ let fragmentWithJSXElements = React.jsxs(
6
+ React.jsxFragment,
7
+ {
8
+ children: React.array([
9
+ ReactDOM.jsx("h1", {children: ?ReactDOM.someElement({React.string("Hi")})}),
10
+ ReactDOM.jsx("p", {children: ?ReactDOM.someElement({React.string("Hello")})}),
11
+ ]),
12
+ },
13
+ )
14
+
15
+ let nestedFragments = React.jsxs(
16
+ React.jsxFragment,
17
+ {
18
+ children: React.array([
19
+ ReactDOM.jsx("h1", {children: ?ReactDOM.someElement({React.string("Hi")})}),
20
+ ReactDOM.jsx("p", {children: ?ReactDOM.someElement({React.string("Hello")})}),
21
+ React.jsx(React.jsxFragment, {children: {React.string("Bye")}}),
22
+ ]),
23
+ },
24
+ )
You can’t perform that action at this time.
0 commit comments