-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tables to the scripts, untested
This also has a lot of bugfixing.
- Loading branch information
1 parent
4faa0c0
commit b092b8c
Showing
12 changed files
with
367 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//1-D table | ||
var a = ["alpha": 1, "beta": 2, "gamma": 3]; | ||
a["beta"] = 6; | ||
|
||
print a; | ||
assert a == ["alpha": 1, "beta": 6, "gamma": 3], "1-D tables failed"; | ||
|
||
//nested | ||
var b = [ | ||
"outer": ["inner": true], | ||
"alpha": 1, | ||
"beta": 2, | ||
"gamma": 3 | ||
]; | ||
|
||
print b; | ||
assert b == ["alpha": 1, "beta": 2, "gamma": 3, "outer": ["inner": true]], "nested tables failed"; | ||
|
||
//test empty tables | ||
var empty = [:]; | ||
|
||
print empty; | ||
assert empty == [:], "empty tables failed"; | ||
|
||
//test trailing commas | ||
var trailing = [ | ||
"alpha":1, | ||
"beta":2, | ||
"gamma":3, | ||
]; | ||
|
||
print trailing; | ||
assert trailing == ["alpha": 1, "beta": 2, "gamma": 3], "trailing tables failed"; |
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,5 @@ | ||
var barr = [ | ||
[1, 2, 3], | ||
// [4, 5, 6], | ||
// [7, 8, 9] | ||
]; |
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
Oops, something went wrong.