-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Function call based on parameters
Functions can now have the same name with different parameters, and the compiler will make the right call based on the parameters supplied.
- Loading branch information
1 parent
91f5ddb
commit b304917
Showing
7 changed files
with
35 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ret=101 | ||
def extern usleep(x: int) | ||
|
||
def sleep(x: float) | ||
let y: float = x * 1000000 | ||
usleep(y as int) | ||
|
||
def sleep(x: int) | ||
usleep(x * 1000000) |
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
#ret=101 | ||
def extern exit(x: int) | ||
|
||
def sleep(x: float) -> int | ||
return 50 | ||
|
||
def sleep(x: int) -> int | ||
return 51 | ||
|
||
exit(sleep(1.0) + sleep(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#ret=101 | ||
import "functioncall.les" | ||
import "function_call.les" | ||
|
||
def extern exit(x: int) | ||
|
||
|
File renamed without changes.