-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for syscall builtin (#631)
- Loading branch information
1 parent
f7955cb
commit 570ec64
Showing
37 changed files
with
359 additions
and
66 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,45 +1,6 @@ | ||
import "std/data/unordered-map"; | ||
import "std/data/pair"; | ||
import "std/os/syscall"; | ||
|
||
f<int> main() { | ||
UnorderedMap<int, String> unorderedMap; | ||
|
||
// Iterate over empty container | ||
{ | ||
foreach Pair<int&, String&> item : unorderedMap { | ||
printf("%d: %s\n", item.getFirst(), item.getSecond()); | ||
} | ||
} | ||
|
||
unorderedMap.upsert(1, String("1")); | ||
unorderedMap.upsert(2, String("2")); | ||
unorderedMap.upsert(3, String("3")); | ||
unorderedMap.upsert(4, String("4")); | ||
unorderedMap.upsert(5, String("5")); | ||
unorderedMap.upsert(99, String("99")); | ||
unorderedMap.upsert(100, String("100")); | ||
unorderedMap.upsert(1265, String("1265")); | ||
unorderedMap.upsert(101, String("101")); | ||
unorderedMap.upsert(102, String("102")); | ||
|
||
// Iterate over filled container | ||
foreach Pair<int&, String&> item : unorderedMap { | ||
printf("%d: %s\n", item.getFirst(), item.getSecond()); | ||
} | ||
} | ||
|
||
|
||
/*f<int> greatestCommonDivisor(int a, int b) { | ||
while b != 0 { | ||
int temp = b; | ||
b = a % b; | ||
a = temp; | ||
} | ||
return a; | ||
string str = "Hello World!\n"; | ||
syscallWrite(FileDescriptor::STDOUT, str); | ||
} | ||
|
||
f<int> main() { | ||
int a = 56; | ||
int gcd = greatestCommonDivisor(a, 98); | ||
printf("GCD of %d and %d is %d.", a, 98, gcd); | ||
}*/ |
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
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
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.