Skip to content

Commit

Permalink
Parse list and list spread in JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Aug 9, 2018
1 parent 0ab0584 commit 0217c11
Show file tree
Hide file tree
Showing 7 changed files with 4,706 additions and 4,356 deletions.
9 changes: 9 additions & 0 deletions formatTest/typeCheckedTests/expected_output/jsx.re
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,12 @@ let div = (~onClick, ~children, ()) => ();
<div onClick=onClickHandler>
<> "foobar" </>
</div>;

/* https://github.com/facebook/reason/issues/1467 */
<Foo> 1 2 </Foo>;

<Foo> 1 2 3 4 </Foo>;

<Foo> <> 1 2 3 4 </> </Foo>;

<Foo> <> 1 2 3 </> </Foo>;
9 changes: 9 additions & 0 deletions formatTest/typeCheckedTests/input/jsx.re
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,12 @@ let onClickHandler = () => ();
let div = (~onClick, ~children, ()) => ();

<div onClick=onClickHandler> <> "foobar" </> </div>;

/* https://github.com/facebook/reason/issues/1467 */
<Foo> ...[1, 2] </Foo>;

<Foo> [1, 2] [3,4] </Foo>;

<Foo> <> [1, 2] [3,4] </> </Foo>;

<Foo> <> ...[1, 2, 3] </> </Foo>;
9 changes: 6 additions & 3 deletions formatTest/unit_tests/expected_output/jsx.re
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ let x = foo /></ bar;
<> foo bar </>
</div>;

<<<<<<< HEAD
/* https://github.com/facebook/reason/issues/2020 */
<div />;

Expand Down Expand Up @@ -330,13 +331,15 @@ let x = foo /></ bar;
)
/>;

switch (foo) {
| `Variant => <Component />
};

/* https://github.com/facebook/reason/issues/2028 */
<Foo bar=M.[] />;

<Foo bar=M.[]> M.[] </Foo>;

<Foo bar=M.[]> ...M.[] </Foo>;

switch (foo) {
| `Variant => <Component />
};
<Foo> 1 2 other </Foo>;
9 changes: 6 additions & 3 deletions formatTest/unit_tests/input/jsx.re
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ let x = foo /></ bar;
<> foo(bar) </>
</div>;

<<<<<<< HEAD
/* https://github.com/facebook/reason/issues/2020 */
<div></div >;

Expand Down Expand Up @@ -227,13 +228,15 @@ let x = foo /></ bar;
))
/>;

switch(foo) {
| `Variant =><Component />
};

/* https://github.com/facebook/reason/issues/2028 */
<Foo bar=M.[]></Foo>;

<Foo bar=M.[]> M.[] </Foo>;

<Foo bar=M.[]> ...M.[] </Foo>;

switch(foo) {
| `Variant =><Component />
};
<Foo> ...[[1,2] , other] </Foo>;

0 comments on commit 0217c11

Please sign in to comment.