tb Implement "#" comments

This commit is contained in:
2025-11-15 22:25:41 +01:00
parent 55b58bbe22
commit e66fe4030d
3 changed files with 12 additions and 4 deletions

View File

@ -193,17 +193,21 @@ bool interp_runstring(char *string, InterpResult **res, bool interactive) {
char *line = string_tokenizealloc_linecontinue(string, "\n");
while (line != NULL) {
if (CONFIG.logcmds) {
uprintf("+"ANSIQ_SETFG_YELLOW"%s"ANSIQ_GR_RESET"\n", line);
}
bool skip;
STRING_CHECK_ALL(line, string_chr_isspace, skip);
if (line[0] == '#') {
skip = true;
}
if (skip) {
ufree(line);
line = string_tokenizealloc_linecontinue(NULL, "\n");
continue;
}
if (CONFIG.logcmds) {
uprintf("+"ANSIQ_SETFG_YELLOW"%s"ANSIQ_GR_RESET"\n", line);
}
Tokenizer tz; ZERO(&tz);
tz_init(&tz, line);