From e66fe4030d94523e171dd27d4931356689b08a75 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 15 Nov 2025 22:25:41 +0100 Subject: [PATCH] tb Implement "#" comments --- base/scripts/mount.tb | 3 +++ base/scripts/rc.tb | 1 + user/tb/interp.c | 12 ++++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/base/scripts/mount.tb b/base/scripts/mount.tb index 539d36e..535d4a3 100644 --- a/base/scripts/mount.tb +++ b/base/scripts/mount.tb @@ -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 diff --git a/base/scripts/rc.tb b/base/scripts/rc.tb index ece295f..a81f63e 100644 --- a/base/scripts/rc.tb +++ b/base/scripts/rc.tb @@ -1,2 +1,3 @@ +# Create an $alias out of basenames of each entry in base:/bin eachfile !.gitkeep base:/bin \ mkaliasbn &EF-ELEM diff --git a/user/tb/interp.c b/user/tb/interp.c index 86d277c..6d5be9d 100644 --- a/user/tb/interp.c +++ b/user/tb/interp.c @@ -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);