terminal: improve REPL prompt, completion, and highlighting

- Cache environment variable names to improve completion performance.
- Refactor terminal styles into constants.
- Move `isAllUpper` to `string.zig` and `meta_names` to `SlashCommand.zig`.
- Align quoted string scanning logic with the slash command parser.
This commit is contained in:
Adrià Arrufat
2026-05-11 15:24:09 +02:00
parent 1abf05aec7
commit 98b082ddc1
4 changed files with 60 additions and 48 deletions

View File

@@ -311,6 +311,14 @@ pub fn isAllWhitespace(text: []const u8) bool {
} else true;
}
pub fn isAllUpper(s: []const u8) bool {
if (s.len == 0) return false;
for (s) |ch| {
if (!std.ascii.isUpper(ch) and !std.ascii.isDigit(ch) and ch != '_') return false;
}
return true;
}
// Discriminatory type that signals the bridge to use arena instead of call_arena
// Use this for strings that need to persist beyond the current call
// The caller can unwrap and store just the underlying .str field