| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
A bit of a chonky commit, but this ports over the remaining (well,
almost) everything from the C implementation to the self-hosted
compiler.
The only things that really remain right now are (1) defer support
and (2) support for constants in local scopes. There were used barely
enough so for now their uses have been removed, but I'll implement
them back later. Not sure how useful (2) is though.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We can now directly expose the `syscallN()` APIs to the program and
define the `open()`, `write()` etc syscalls in the stdlib. This
simplifies the implementation a decent bunch :^)
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This was possible, but very tedious to do by hand before. Now we
automate it based on the number of arguments.
Note that currently we can't just add `syscall3()` etc as builtins
because the actual numbers for the system calls vary from one system
to another, and we want to maintain support for macOS and Linux (at
least for now).
|
| |
|
|
|
| |
`putc`, `puts`, and `putnum` in `std/common.cup` are now implemented
in terms of the `write()` syscall.
|
|
|
Probably want to add more builtins in the future, so pulling it out
of `parser.c` seems like the reasonable thing to do
|