Skip to content

Commit a39f84b

Browse files
committed
Add syntax
1 parent 922f348 commit a39f84b

File tree

6 files changed

+2403
-1997
lines changed

6 files changed

+2403
-1997
lines changed

src/lib/interpreter/interpreter.lalrpop

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pop:() ={
265265
vm.arch.sp = (vm.arch.sp as u32 + 2) as u16;
266266
},
267267
// mem
268-
<start:@L> "pop" <m:memory_addr> => {
268+
<start:@L> "pop" "word" <m:memory_addr> => {
269269
let ss = vm.arch.ss as usize*0x10;
270270
let sp = vm.arch.sp as usize;
271271
let base = Address::calculate_from_offset(ss,sp);
@@ -306,7 +306,7 @@ push:() = {
306306
vm.mem[inc_addr(base,1)] = hb;
307307
},
308308
// mem
309-
<start:@L> "push" <m:memory_addr> => {
309+
<start:@L> "push" "word" <m:memory_addr> => {
310310
vm.arch.sp = (vm.arch.sp as u32 as i32 - 2) as u32 as u16;
311311
let ss = vm.arch.ss as usize*0x10;
312312
let sp = vm.arch.sp as usize;

src/lib/interpreter/interpreter.rs

+647-635
Large diffs are not rendered by default.

src/lib/preprocessor/preprocessor.lalrpop

+2-2
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ pop:() ={
572572
context.mapper.add_entry(start);
573573
},
574574
// mem
575-
<start:@L> <q:quote_pop> <m:memory_addr> => {
575+
<start:@L> <q:quote_pop> "word" <m:memory_addr> => {
576576
out.code.push(format!("pop {}",m));
577577
context.mapper.add_entry(start);
578578
},
@@ -599,7 +599,7 @@ push:() = {
599599
context.mapper.add_entry(start);
600600
},
601601
// mem
602-
<start:@L> <q:quote_push> <m:memory_addr> => {
602+
<start:@L> <q:quote_push> quote_word_length <m:memory_addr> => {
603603
out.code.push(format!("push {}",m));
604604
context.mapper.add_entry(start);
605605
},

0 commit comments

Comments
 (0)