Closed tromey closed 7 years ago
Close but not quite done; still have some other bugs to fix in the generation.
condition-case is still wrong. it has to re-throw when no handler matches.
How handlerlist is popped is wrong, this has to be explicit in the IR
The C back end assumes that a few special functions can be defined by Emacs to implement primitives like
catch
. Seeelcomp--c-direct-renames
... the names here are invented and can be changed, but what is important is implementing these in the C core.:elcomp-fetch-condition
: evaluates to the error value in the error branch of acondition-case
:save-excursion-save
and:save-excursion-restore
: save and restore excursion data. These might be very easy based on the implementation ofFsave_excursion
:save-restriction-save
,:save-restriction-restore
: Ditto for restrictions. Also maybe easy.:unwind-protect-continue
: Called at the end of anunwind-protect
to re-throw the exception in flight:catch-value
: Return the value thrown viathrow
PUSH_HANDLER
is emitted in various spots but is gone fromlisp.h
handler_matches
: emitted byelcomp--c-emit-condition-case
to handle case matching