From da651355b99c83fd0f69482f2fb2ece4451c6c87 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Mon, 1 Aug 2022 13:16:07 +0200 Subject: [PATCH] Added a few more tests --- src/backend/vm.nim | 5 ++--- src/util/debugger.nim | 9 ++++++-- tests/fib.pn | 51 +++++++++++++++++++++++++++++++++++++++++++ tests/import/a.pn | 0 tests/import/b.pn | 0 tests/lt_gt.pn | 6 +++++ 6 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 tests/fib.pn create mode 100644 tests/import/a.pn create mode 100644 tests/import/b.pn create mode 100644 tests/lt_gt.pn diff --git a/src/backend/vm.nim b/src/backend/vm.nim index 531668c..99a5fee 100644 --- a/src/backend/vm.nim +++ b/src/backend/vm.nim @@ -263,12 +263,11 @@ proc constReadUInt8(self: PeonVM, idx: int): PeonObject = result = PeonObject(kind: UInt8, uTiny: self.chunk.consts[idx]) -proc constReadString(self: PeonVM, idx: int): PeonObject = +proc constReadString(self: PeonVM, size: int, idx: int): PeonObject = ## Reads a constant from the ## chunk's constant table and ## returns a Peon object. Assumes ## the constant is a string - let size = self.readLong() result = PeonObject(kind: String, str: self.chunk.consts[idx..`(a, b: int): bool {return b < a;} + + +3 > 2; +2 < 3;