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

@ -1,3 +1,6 @@
print 'Mounting filesystems...\n'
setlogcmds yes
# MOUNTPOINT FILESYSTEM DEVICE NAME DO FORMATTING
$fs mount -mp uhome -fs LittleFS -dev atasd-ch0-M-part2 -fmt no

View File

@ -1,2 +1,3 @@
# Create an $alias out of basenames of each entry in base:/bin
eachfile !.gitkeep base:/bin \
mkaliasbn &EF-ELEM

View File

@ -193,18 +193,22 @@ 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);