#include #include #include #include #include #include "runtime.h" #include "interp.h" RtCmd *RTCMDS = NULL; #define RTCMD(name) \ do { \ RtCmd *_cmd = dlmalloc(sizeof(*_cmd)); \ _cmd->cmdname = #name; \ _cmd->fn = rt_##name; \ LL_APPEND(RTCMDS, _cmd); \ } while(0) bool rt_print(Token *tks) { Token *tk = tks; while (tk) { uprintf("%.*s", (int)tk->len, tk->ptr); if (tk->next != NULL) { uprintf(" "); } tk = tk->next; } return true; } void rt_init(void) { RTCMD(print); }