Right now there's no support for the built-in functions gawk provides. It would be nice if you can add placeholders for them and implement the trivial ones. The call glue is also missing from lower.rs; just reuse what's already there for user calls, and you can probably get away with passing the AST enum of them inside instruction (instead of the current name: NonLocal).
However, gawk built-in functions do have some overloading for different arg counts (like the third argument of sub), which is a dark corner they are low-key trying to move away from. Hence, in the VM it's probably cleanest to pass a slice of values with Registers::get_range() and handle it at the callee level.
Also note that I'm not sure all of them are added to the lexer/AST; haven't fully checked.
Right now there's no support for the built-in functions gawk provides. It would be nice if you can add placeholders for them and implement the trivial ones. The call glue is also missing from
lower.rs; just reuse what's already there for user calls, and you can probably get away with passing the AST enum of them inside instruction (instead of the currentname: NonLocal).However, gawk built-in functions do have some overloading for different arg counts (like the third argument of
sub), which is a dark corner they are low-key trying to move away from. Hence, in the VM it's probably cleanest to pass a slice of values withRegisters::get_range()and handle it at the callee level.Also note that I'm not sure all of them are added to the lexer/AST; haven't fully checked.