File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change 11import { Sleep } from "$ts/sleep" ;
22import { tryParseInt } from "$ts/util" ;
3+ import { tryJsonParse } from "$ts/util/json" ;
34import type { BasicLang } from "$types/system/basic" ;
4- import { tryJsonParse } from "../util" ;
55import { BasicCommand } from "./command" ;
66import { 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 ;
Load diff This file was deleted.
Original file line number Diff line number Diff line change 11import type { IArcTerminal } from "$interfaces/IArcTerminal" ;
22import type { IServiceHost } from "$interfaces/IServiceHost" ;
33import type { IUserDaemon } from "$interfaces/IUserDaemon" ;
4+ import { __Console__ } from "$ts/console" ;
45import { SysDispatch } from "$ts/env" ;
56import { Process } from "$ts/kernel/mods/stack/process/instance" ;
67import 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
You can’t perform that action at this time.
0 commit comments