Commit graph

4 commits

Author SHA1 Message Date
Evgeniy Stratonikov
b693d54282 compiler: count local variables on the go
Create local variables as they are needed and remove `INITSLOT`
if there were no locals. This helps to eliminate a whole class
of bugs when calculated and real amount mismatched.
2021-05-19 11:50:07 +03:00
Evgenii Stratonikov
3d8c7af66c compiler: handle void call to recover()
Other builtins such as `len` and `make` can be ignored,
because not-assigning `make` result is catched by parser.
2020-09-02 15:20:43 +03:00
Evgenii Stratonikov
5d82b82efb compiler: support recover() 2020-08-27 10:28:50 +03:00
Evgenii Stratonikov
fa1d1a8b00 compiler: support defer statement
Compile `defer` statement to a TRY/ENDFINALLY opcode pair.
2020-08-27 10:28:50 +03:00