Constant fold all kinds of constants

This patch exports all the binary operator builtins functions from
builtin.c and uses them for constant folding in the parser, allowing
constant folding to work will all kinds and combinations of constants.

Now string*number,  $ARGS+$ARGS,  string/string,  etc will also be
constant folded and the implementation of constant folded operators and
runtime operators will be the same.

And thanks to the new ERRORK bytecode operation, errors are constant
folded too! (e.g. 1 / 0   [] * {}   etc)
This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-08-04 11:47:34 -05:00
1 parent 5fc5453409
commit 3b6e7ddd72
5 files changed
+841 -894

No files matched your search

Generated
+772 -804
View File
File diff suppressed because it is too large. Load diff