diff --git a/components/interpreter/program.ts b/components/interpreter/program.ts index 379dfd1..1c1edcc 100644 --- a/components/interpreter/program.ts +++ b/components/interpreter/program.ts @@ -93,6 +93,6 @@ export class Program { } this.clearStd(); - return this.interpreter.run(code, this.verbose, true); + return this.interpreter.repl(code, this.verbose, true); } } diff --git a/programs/babyjs/babyjs.ts b/programs/babyjs/babyjs.ts index 6b78f8d..064f12c 100644 --- a/programs/babyjs/babyjs.ts +++ b/programs/babyjs/babyjs.ts @@ -45,13 +45,13 @@ export class BabyJs { } runOnce(code: string | null, debug: boolean = false) { - this.run(code, debug, true); + this.repl(code, debug, true); } /** * when the interpreter stores global variables. * Those variables should persist throughout the REPL session. */ - run(code: string | null = null, debug: boolean = false, once: boolean = false) { + repl(code: string | null = null, debug: boolean = false, once: boolean = false) { if (!code) return this.nextLoop(debug, once); // 1. scan text, turn them into tokens that the language recognizes @@ -94,7 +94,7 @@ export class BabyJs { return; } - this.run(nextCode, debug); + this.repl(nextCode, debug); } runFile(filepath: string) { diff --git a/programs/babyjs/index.ts b/programs/babyjs/index.ts index 4152205..2068f4a 100644 --- a/programs/babyjs/index.ts +++ b/programs/babyjs/index.ts @@ -7,4 +7,4 @@ const baby = new BabyJs(); // const initialTest = "print 0 + 3 / (2 * 5);"; const initialTest = `let test = "hello world";`; console.log("running initial test of: ", initialTest); -baby.run(initialTest, true); +baby.repl(initialTest, true); diff --git a/programs/dagdog/dagdog.ts b/programs/dagdog/dagdog.ts index 25fe884..7014773 100644 --- a/programs/dagdog/dagdog.ts +++ b/programs/dagdog/dagdog.ts @@ -45,13 +45,13 @@ export class DagDog { } runOnce(code: string | null, debug: boolean = false) { - this.run(code, debug, true); + this.repl(code, debug, true); } /** * when the interpreter stores global variables. * Those variables should persist throughout the REPL session. */ - run(code: string | null = null, debug: boolean = false, once: boolean = false) { + repl(code: string | null = null, debug: boolean = false, once: boolean = false) { if (!code) return this.nextLoop(debug, once); // 1. scan text, turn them into tokens that the language recognizes @@ -94,7 +94,7 @@ export class DagDog { return; } - this.run(nextCode, debug); + this.repl(nextCode, debug); } runFile(filepath: string) { diff --git a/programs/dagdog/index.ts b/programs/dagdog/index.ts index 6e2f8f8..d55b17c 100644 --- a/programs/dagdog/index.ts +++ b/programs/dagdog/index.ts @@ -7,4 +7,4 @@ const puppy = new DagDog(); // const initialTest = "print 0 + 3 / (2 * 5);"; const initialTest = `let test = "hello world";`; console.log("running initial test of: ", initialTest); -puppy.run(initialTest, true); +puppy.repl(initialTest, true);