From c8383c0ab0df5f605cd871c3795ec5fabf3b9bc1 Mon Sep 17 00:00:00 2001 From: Runic <49625808+R-unic@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:07:05 -0400 Subject: [PATCH 1/4] Update fibonacci.p --- tests/fibonacci.p | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fibonacci.p b/tests/fibonacci.p index 61a6cfdc..cd65ec5c 100644 --- a/tests/fibonacci.p +++ b/tests/fibonacci.p @@ -2,4 +2,4 @@ int fn fib(int n) { return n == 1 or n == 2 ? 1 : fib(n - 1) + fib(n - 2) } -fib(3) \ No newline at end of file +## fib(3) \ No newline at end of file From 1bc4553d5a5f5de18854493d63c8568c4bbeebc0 Mon Sep 17 00:00:00 2001 From: Runic <49625808+R-unic@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:11:02 -0400 Subject: [PATCH 2/4] test: update intrinsic interpreter tests --- tools/unit-tests/interpreter-test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/unit-tests/interpreter-test.ts b/tools/unit-tests/interpreter-test.ts index 4874b27e..114ed759 100644 --- a/tools/unit-tests/interpreter-test.ts +++ b/tools/unit-tests/interpreter-test.ts @@ -93,7 +93,8 @@ describe(Interpreter.name, () => { evaluate("eval('1 + 2')")?.should.equal(3); }); it("evaluates intrinsics", () => { - evaluate("__version")?.should.equal("v" + pkg.version); + evaluate("version$")?.should.equal("v" + pkg.version); + evaluate("filename$")?.should.equal("test"); }); describe("evaluates general tests (tests/)", () => { testFiles.forEach((file) => { From f69bb1ff6ef494c2d06c7baddbfc2896e6f28c21 Mon Sep 17 00:00:00 2001 From: Runic <49625808+R-unic@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:15:04 -0400 Subject: [PATCH 3/4] Update p.ts --- tools/p.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/p.ts b/tools/p.ts index 5bdff35f..d32e6a0b 100644 --- a/tools/p.ts +++ b/tools/p.ts @@ -76,6 +76,6 @@ export default class P { this.binder = new Binder; this.resolver = new Resolver; this.typeChecker = new TypeChecker; - this.interpreter = new Interpreter(this, this.resolver, this.binder); + this.interpreter = new Interpreter(this, this.resolver, this.binder, this.fileName); } } \ No newline at end of file From 579c203e5bd869c6cfa34d60a247ea7f4f6064ac Mon Sep 17 00:00:00 2001 From: Runic <49625808+R-unic@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:16:13 -0400 Subject: [PATCH 4/4] Update p.ts --- tools/p.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/p.ts b/tools/p.ts index d32e6a0b..d9397fe3 100644 --- a/tools/p.ts +++ b/tools/p.ts @@ -76,6 +76,6 @@ export default class P { this.binder = new Binder; this.resolver = new Resolver; this.typeChecker = new TypeChecker; - this.interpreter = new Interpreter(this, this.resolver, this.binder, this.fileName); + this.interpreter = new Interpreter(this, this.resolver, this.binder, this.interpreter.fileName); } } \ No newline at end of file