-
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.
feat: Added varargs, currently only for extern functions, added print…
… for all types
- Loading branch information
1 parent
fc7390a
commit 510f78a
Showing
4 changed files
with
42 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
def extern printf(x: str) | ||
def extern printf(fmt: str, ...) | ||
|
||
def print(x: str) | ||
printf(x) | ||
printf("\n") | ||
printf("%s\n", x) | ||
|
||
def print(x: int) | ||
printf("%d\n", x) | ||
|
||
def print(x: float) | ||
printf("%g\n", x) | ||
|
||
def print(x: bool) | ||
if x | ||
print("true") | ||
else | ||
print("false") |