aboutsummaryrefslogtreecommitdiff
path: root/examples/functions.cup
Commit message (Collapse)AuthorAgeFilesLines
* Fix examples to include return type on main functionMustafa Quraish2022-02-021-1/+1
| | | | With the fancy new type checking these are now required.
* Functions, yay!Mustafa Quraish2022-01-301-0/+13
We now support function calls! We don't have support for forward declaring functions right now though, so no mutual recursion is possible. The arguments are passed via the stack instead of through registers (unlike the x86_64 calling convention, I think). We'll probably need some sort of primitives built into the language for syscalls eventually because of this. Return types are also not checked, and right now it's possible to have a function that doesn't return anything even when the caller expects it to, error checking and reporting definitely needs to be improved.