2// (C) 2026 Daniel McGuire
3// This file is licensed under the MIT License
10puts("Phasor Shell\n(C) 2026 Daniel McGuire\n");
12fn trim(s: string) -> string {
17 while (i < n && substr(s, i, 1) == " ") {
22 out = concat(out, substr(s, i, 1));
26 var end = len(out) - 1;
27 while (end >= 0 && substr(out, end, 1) == " ") {
31 if (end < 0) return "";
32 return substr(out, 0, end + 1);
35fn starts_with(input: string, prefix: string) -> bool {
36 if (len(input) < len(prefix)) return false;
37 return substr(input, 0, len(prefix)) == prefix;
42 printf("%s$ ", fcd());
47 if (line.len() == 0) {
51 if (starts_with(line, "exit")) {
67 puts_error("Unknown error");