Add support for defaults to bytecode, compiler and VM

This commit is contained in:
Daniel Watkins
2018-08-27 22:16:51 -04:00
parent 0787115d07
commit 2cecd362fe
9 changed files with 113 additions and 25 deletions

View File

@@ -37,6 +37,12 @@ impl CodeObject {
}
}
bitflags! {
pub struct FunctionOpArg: u8 {
const HAS_DEFAULTS = 0x01;
}
}
pub type Label = usize;
#[derive(Debug, Clone, PartialEq)]
@@ -88,7 +94,9 @@ pub enum Instruction {
JumpIfFalse {
target: Label,
},
MakeFunction,
MakeFunction {
flags: FunctionOpArg,
},
CallFunction {
count: usize,
},