Open travis-heavener opened 1 week ago
WIP as of 0bdd981
Added as of commit 4d59318, still need to force return on non-void functions, prevent invalid parameters being provided, and handle void as a return type.
Improved in commit 0145bc8, working on forcing parameters, supporting void types, and confirming return sizing now.
Also needed: prevent duplicate functions but allow distinction from arguments.
Improve the lexer and parser to support calling functions with arguments. The actual arguments passed to a function must also be dealt with in the t_assembler.cpp, since they're scoped variables. In the expression assembler when a function is met, just evaluate the expression inside for each argument, push them to the stack, and call the corresponding label after looking it up. After the end of the label is met, grab the return value out of DX and push that onto the stack in the expression assembler.