-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Handle dict literal syntax Closes #6545 * Update test * Move isTupleArray to res_parsetree_viewer * Map locations correctly * Fix location in parsing comments printing * Make Dict limit to List grammar-wise * Add changelog entry
- Loading branch information
Showing
15 changed files
with
425 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// empty dict | ||
let x = dict{} | ||
|
||
// one value | ||
let x = dict{"foo": "bar"} | ||
|
||
// two values | ||
let x = dict{"foo": "bar", "bar": "baz"} | ||
|
||
let baz = "foo" | ||
let x = dict{"foo": "bar", "bar": "baz", "baz": baz} |
7 changes: 7 additions & 0 deletions
7
jscomp/syntax/tests/parsing/grammar/expressions/expected/dict.res.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let x = Js.Dict.fromArray [||] | ||
let x = Js.Dict.fromArray [|("foo", {js|bar|js})|] | ||
let x = Js.Dict.fromArray [|("foo", {js|bar|js});("bar", {js|baz|js})|] | ||
let baz = {js|foo|js} | ||
let x = | ||
Js.Dict.fromArray | ||
[|("foo", {js|bar|js});("bar", {js|baz|js});("baz", baz)|] |
Oops, something went wrong.