mirror of
https://gitlab.cs.washington.edu/fidelp/frustration.git
synced 2025-02-05 20:45:59 +01:00
ret with nothing on the return stack should exit
This commit is contained in:
parent
c90591b864
commit
b1a477ea99
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::cmp;
|
||||
use std::io;
|
||||
//use std::convert::TryFrom;
|
||||
use std::process;
|
||||
use std::convert::TryInto;
|
||||
|
||||
//const CORE_SIZE: usize = 65280
|
||||
|
@ -48,7 +48,7 @@ struct TableEntry {
|
|||
|
||||
// NOTE: lazy_static or SyncLazy would allow nicer init
|
||||
const PRIMITIVES: [TableEntry; 8] = [
|
||||
TableEntry {f: ret , name: ShortName {bytes: ['r' as u8, 'e' as u8, 't' as u8], length: 1}},
|
||||
TableEntry {f: ret , name: ShortName {bytes: ['r' as u8, 'e' as u8, 't' as u8], length: 3}},
|
||||
TableEntry {f: dot , name: ShortName {bytes: ['.' as u8, 32, 32], length: 1}},
|
||||
TableEntry {f: store, name: ShortName {bytes: ['!' as u8, 32, 32], length: 1}},
|
||||
TableEntry {f: load , name: ShortName {bytes: ['@' as u8, 32, 32], length: 1}},
|
||||
|
@ -148,6 +148,9 @@ fn inner(c: &mut Core) {
|
|||
}
|
||||
|
||||
fn ret(c: &mut Core) {
|
||||
if c.trs == 0 {
|
||||
std::process::exit(0);
|
||||
}
|
||||
c.ip = from_r(c);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue