-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into yoav/super_calls2
- Loading branch information
Showing
48 changed files
with
2,128 additions
and
98 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
bring "./bring_local_self.w" as foo; | ||
// ^ error: Cannot bring a module into itself |
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,3 @@ | ||
bring "./file_with_variables.w" as stuff; | ||
|
||
new stuff.Bar(); |
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,12 @@ | ||
// used by bring_local_variables.w | ||
|
||
bring cloud; | ||
|
||
let x = 5; | ||
let y = ["hello", "world"]; | ||
let z = new cloud.Bucket(); | ||
|
||
class Bar { | ||
x: num; | ||
} | ||
|
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,25 @@ | ||
bring util; | ||
|
||
let string = "https://www.winglang.io/docs"; | ||
let base64Encode = util.base64Encode(string); | ||
let base64urlEncode = util.base64Encode(string, true); | ||
let base64Decode = util.base64Decode("aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw=="); | ||
let base64urlDecode = util.base64Decode("aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw", true); | ||
|
||
assert(base64Encode == "aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw=="); | ||
assert(base64urlEncode == "aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw"); | ||
assert(base64Decode == string); | ||
assert(base64urlDecode == string); | ||
|
||
test "inflight base64" { | ||
let string = "https://www.winglang.io/docs"; | ||
let base64Encode = util.base64Encode(string); | ||
let base64urlEncode = util.base64Encode(string, true); | ||
let base64Decode = util.base64Decode("aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw=="); | ||
let base64urlDecode = util.base64Decode("aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw", true); | ||
|
||
assert(base64Encode == "aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw=="); | ||
assert(base64urlEncode == "aHR0cHM6Ly93d3cud2luZ2xhbmcuaW8vZG9jcw"); | ||
assert(base64Decode == string); | ||
assert(base64urlDecode == string); | ||
} |
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,29 @@ | ||
bring "./store.w" as file1; | ||
bring "./subdir/subfile.w" as file2; | ||
bring "./subdir/empty.w" as file3; | ||
|
||
// classes from other files can be used | ||
let store = new file1.Store(); | ||
let q = new file2.Q(); | ||
|
||
test "add data to store" { | ||
store.store("foo"); | ||
} | ||
|
||
// structs from other files can be used | ||
let s = file1.Point { | ||
x: 1, | ||
y: 2, | ||
}; | ||
|
||
// enums from other files can be used | ||
let c = file1.Color.BLUE; | ||
assert(c != file1.Color.RED); | ||
|
||
// interfaces from other files can be used | ||
class Triangle impl file1.Shape { | ||
area(): num { | ||
return 1; | ||
} | ||
} | ||
let t = new Triangle(); |
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,26 @@ | ||
bring cloud; | ||
|
||
class Store { | ||
b: cloud.Bucket; | ||
init() { | ||
this.b = new cloud.Bucket(); | ||
} | ||
inflight store(data: str) { | ||
this.b.put("data.txt", data); | ||
} | ||
} | ||
|
||
enum Color { | ||
RED, | ||
GREEN, | ||
BLUE, | ||
} | ||
|
||
struct Point { | ||
x: num; | ||
y: num; | ||
} | ||
|
||
interface Shape { | ||
area(): num; | ||
} |
Empty file.
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 @@ | ||
class Q {} |
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.