forked from lightscript/babel-plugin-lightscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 4b4979e Author: William C. Johnson <wcjohnson@oigroup.net> Date: Thu Sep 28 21:09:41 2017 -0400 Changelog commit d809a5e Author: William C. Johnson <wcjohnson@oigroup.net> Date: Thu Sep 28 19:57:21 2017 -0400 Throw on empty comprehensions commit 8b37b95 Author: William C. Johnson <wcjohnson@oigroup.net> Date: Thu Sep 28 19:50:22 2017 -0400 Fix: `LabeledStatement` bodies now included in tail transforms commit dab8a33 Author: William C. Johnson <wcjohnson@oigroup.net> Date: Thu Sep 28 19:07:51 2017 -0400 Enhanced comprehensions use `…` syntax
- Loading branch information
Showing
52 changed files
with
261 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "`await` is not allowed within Comprehensions; instead, await the Comprehension (eg; `y <- [for x of xs: x]`)." | ||
"throws": "`await` is not allowed within Comprehensions; instead, await the Comprehension." | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/enhanced-comprehensions/assignment-expr/actual.js
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[for idx i in Array(10): | ||
[...for idx i in Array(10): | ||
now x = f(i) | ||
] |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
f() -/> | ||
<- [for now x of arr: | ||
<- [...for now x of arr: | ||
<- x | ||
] |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "`await` is not allowed within Comprehensions; instead, await the Comprehension (eg; `y <- [for x of xs: x]`)." | ||
"throws": "`await` is not allowed within Comprehensions; instead, await the Comprehension." | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
[for elem x in y: x] | ||
[...for elem x in y: x] |
6 changes: 3 additions & 3 deletions
6
test/fixtures/enhanced-comprehensions/closure-nested-deep/actual.js
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[for idx i in Array(10): | ||
[...for idx i in Array(10): | ||
for idx j in a: | ||
if i < 5: | ||
f() -> | ||
{for idx k in Array(10): | ||
{...for idx k in Array(10): | ||
if k > 7: | ||
(k, g() -> function h() { [i,j,k] }) | ||
{[k]: g() -> function h() { [i,j,k] }} | ||
} | ||
] |
4 changes: 0 additions & 4 deletions
4
test/fixtures/enhanced-comprehensions/closure-nested-semantic.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
[ for idx i in Array(10): f() -> g() -> i ] | ||
[ ...for idx i in Array(10): f() -> g() -> i ] |
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,4 @@ | ||
closures = [ ...for idx i in Array(10): f() -> g() -> i ] | ||
closureResults = [ ...for elem f in closures: f()() ] | ||
|
||
assert.deepEqual(closureResults, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
[ for idx i in Array(10): f() -> i ] | ||
[ ...for idx i in Array(10): f() -> i ] |
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,4 @@ | ||
closures = [ ...for idx i in Array(10): f() -> i ] | ||
closureResults = [ ...for elem f in closures: f() ] | ||
|
||
assert.deepEqual(closureResults, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) |
Oops, something went wrong.