diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 15:13:52 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 15:13:52 +0100 |
| commit | 3a488562804af56f5df47e887a884b80acaa0f81 (patch) | |
| tree | aa908c588e458734ba02d66168695098906859a6 /src/vm.rs | |
| parent | b81e250fab7f54838a9b205e51a49bd5b932c618 (diff) | |
| download | sylt-3a488562804af56f5df47e887a884b80acaa0f81.tar.gz | |
Unreachable statement
Diffstat (limited to 'src/vm.rs')
| -rw-r--r-- | src/vm.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -44,6 +44,7 @@ pub enum Op { Greater, // > AssertEqual, + Unreachable, ReadLocal(usize), Assign(usize), @@ -148,7 +149,7 @@ impl VM { } pub fn run(&mut self) -> Result<(), Error>{ - const PRINT_WHILE_RUNNING: bool = true; + const PRINT_WHILE_RUNNING: bool = false; const PRINT_BLOCK: bool = true; if PRINT_BLOCK { @@ -176,6 +177,10 @@ impl VM { error!(self, ErrorKind::InvalidProgram); } + Op::Unreachable => { + error!(self, ErrorKind::Unreachable); + } + Op::Pop => { self.stack.pop(); } |
