Skip to content

Commit e70576e

Browse files
committed
small things
1 parent c2945c3 commit e70576e

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/ts/basic/config/term.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ export function ArcTermBasicConfig(term: IArcTerminal): BasicLang.Config {
6666
return arrayBufferToText(content) ?? "";
6767
},
6868
uuid: () => UUID(),
69+
len: (s) => s?.length ?? 0,
6970
},
70-
slowdown: 100,
71+
slowdown: 10,
7172
commands: [
7273
PrintCommand,
7374
IfCommand,

src/ts/basic/engine/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Sleep } from "$ts/sleep";
22
import { tryParseInt } from "$ts/util";
3+
import { tryJsonParse } from "$ts/util/json";
34
import type { BasicLang } from "$types/system/basic";
4-
import { tryJsonParse } from "../util";
55
import { BasicCommand } from "./command";
66
import { REGEXES } from "./regex";
77

@@ -90,6 +90,7 @@ export class ArcBasicEngine {
9090
}
9191

9292
async replaceVariables(input: string, runFunctions = true): Promise<string> {
93+
if (!input) return input;
9394
if (runFunctions) input = await this.runFunctions(input);
9495
const getters = [...input.matchAll(REGEXES.VARGET)];
9596

@@ -104,6 +105,8 @@ export class ArcBasicEngine {
104105
}
105106

106107
async runFunctions(input: string) {
108+
if (!input) return input;
109+
107110
const matches = [...input.matchAll(REGEXES.FUNCTION)];
108111

109112
if (!matches.length) return input;

src/ts/basic/util.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/ts/terminal/process.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { IArcTerminal } from "$interfaces/IArcTerminal";
22
import type { IServiceHost } from "$interfaces/IServiceHost";
33
import type { IUserDaemon } from "$interfaces/IUserDaemon";
4+
import { __Console__ } from "$ts/console";
45
import { SysDispatch } from "$ts/env";
56
import { Process } from "$ts/kernel/mods/stack/process/instance";
67
import type { Arguments } from "$types/terminal";
@@ -49,6 +50,7 @@ export class TerminalProcess extends Process {
4950
} catch (e) {
5051
term.handleCommandError(e as Error, this.constructor as any);
5152
term.lastCommandErrored = true;
53+
__Console__.warn(e);
5254
r(0);
5355
}
5456

0 commit comments

Comments
 (0)