mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
loop
This commit is contained in:
parent
a93412c3cd
commit
09deb07e85
4 changed files with 36 additions and 21 deletions
|
|
@ -14,6 +14,8 @@ pub struct FnBlock<'bc> {
|
|||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Instr {
|
||||
Nop,
|
||||
|
||||
/// Store the current value on the stack to the stack location with the local offset `usize`
|
||||
Store(usize),
|
||||
/// Load the variable value from the local offset `usize` onto the stack
|
||||
|
|
@ -39,8 +41,8 @@ pub enum Instr {
|
|||
/// Println the value on top of the stack
|
||||
Print,
|
||||
|
||||
/// If the current stack value is true, skip `usize` instructions.
|
||||
JumpFalse(usize),
|
||||
/// If the current stack value is true, skip `usize` instructions. When jumping backwards
|
||||
JumpFalse(isize),
|
||||
/// Same as `JumpCond`, but unconditional
|
||||
Jmp(usize),
|
||||
Jmp(isize),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue