-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Refactor parser * Savepoint * Refactor CliFunc and TypesInterpreter * Fix CliFunc * Fix parser tests * Fix tests compilation * Fix callArrowToRaw * Fix co parsing, add tests * Add par tests * Fix field parsing, add test * Return ability to CallArrowToken * Fix names * Refactor and add comments * Refactor, add comments * Fix
- Loading branch information
1 parent
6146f8e
commit f562bd4
Showing
43 changed files
with
885 additions
and
574 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,7 @@ | ||
aqua Main | ||
service Srv("srv"): | ||
call(x: i32) -> i32 | ||
|
||
use DECLARE_CONST, decl_bar from "declare.aqua" as Declare | ||
|
||
export SomeService, handleAb, bug214, checkAbCalls | ||
|
||
service SomeService("wed"): | ||
getStr(s: string) -> string | ||
|
||
ability SomeAb: | ||
someArrow(s: string) -> string, string | ||
str: string | ||
|
||
ability SecondAb: | ||
arrow(s: string) -> string | ||
num: u32 | ||
|
||
func funcStr(s: string) -> string, string: | ||
strInFunc <- SomeService.getStr(Declare.DECLARE_CONST) | ||
strInFunc2 <- SomeService.getStr(s) | ||
<- strInFunc, strInFunc2 | ||
|
||
func handleSecAb {SomeAb, SecondAb}() -> string, string, string, u32: | ||
SomeAb.someArrow("eferfrfrf") | ||
b, c <- SomeAb.someArrow("efre") | ||
d <- SecondAb.arrow(SomeAb.str) | ||
<- b, c, d, SecondAb.num | ||
|
||
func returnAb(s: string) -> SomeAb: | ||
SomeAb = SomeAb(someArrow = funcStr, str = s) | ||
<- SomeAb | ||
|
||
func handleAb(fff: string) -> string, string, string, u32: | ||
SomeAb = returnAb(fff) | ||
SecondAb = SecondAb(arrow = funcStr, num = 12) | ||
res1, res2, res3, res4 <- handleSecAb{SomeAb, SecondAb}() | ||
<- res1, res2, res3, res4 | ||
|
||
data Struct: | ||
int: i8 | ||
|
||
ability Simple: | ||
st: Struct | ||
arrow(x: i8) -> bool | ||
|
||
ability Complex: | ||
simple: Simple | ||
field: string | ||
|
||
func foo{Complex, Simple}() -> bool, bool: | ||
closure = () -> bool: | ||
<- Simple.st.int >= 0 | ||
res <- closure() | ||
<- Complex.simple.arrow( | ||
Complex.simple.st.int | ||
), res | ||
|
||
func bug214() -> bool, bool: | ||
closure = (x: i8) -> bool: | ||
<- x > 0 | ||
|
||
MyComplex = Complex( | ||
simple = Simple( | ||
st = Struct(int = 0), | ||
arrow = closure | ||
), | ||
field = "complex" | ||
) | ||
|
||
res1, res2 <- foo{MyComplex, MyComplex.simple}() | ||
<- res1, res2 | ||
|
||
ability SSS: | ||
arrow(x: i8) -> bool | ||
|
||
ability CCCC: | ||
arrow(x: i8) -> bool | ||
simple: SSS | ||
|
||
func checkAbCalls() -> bool, bool: | ||
closure = (x: i8) -> bool: | ||
<- x > 20 | ||
|
||
MySSS = SSS(arrow = closure) | ||
MyCCCC = CCCC(simple = MySSS, arrow = MySSS.arrow) | ||
|
||
<- MySSS.arrow(42), MyCCCC.arrow(12) | ||
func main() -> i32: | ||
arr = [1, 2, 3] | ||
a <- Srv.call(0) | ||
<- arr[Srv.call(1)] |
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.