albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
895 stars 149 forks source link

sqstd_seterrorhandlers #223

Closed wpbirney closed 3 years ago

wpbirney commented 3 years ago

when sqstd_dofile fails due to a compile issue i get invalid error info printed

AN ERROR HAS OCCURRED []

CALLSTACK
*FUNCTION [()] *FUNCTION [%s()] %s line [%d]
 line [13]

LOCALS
[] 4739699
[] ARRAY
[] TABLE

here is initialization of the VM the print functions are taken directly from etc/minimal.c

sqvm = sq_open(1024);
sq_pushroottable(sqvm);
sqstd_register_iolib(sqvm);

sqstd_seterrorhandlers(sqvm);

sq_setprintfunc(sqvm, printfunc, errorfunc);

then later when i run

sqstd_dofile(sqvm, "init.nut", false, true);

calling a function that does not exist on purpose for testing yields the above error messages with printf symbols not replaced

wpbirney commented 3 years ago

whoops sorry. found an issue in my print funcs. everything is working as expected!