tb Implement "#" comments
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user