feat: function (WIP)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use ecow::EcoString;
|
||||
|
||||
use crate::ty::internal::{Const, Param};
|
||||
use crate::ty::internal::Const;
|
||||
|
||||
type Slice<T> = Box<[T]>;
|
||||
|
||||
@@ -35,7 +35,17 @@ pub enum OpCode {
|
||||
/// return a value
|
||||
Ret,
|
||||
/// make a function
|
||||
Func { param: Param, length: usize },
|
||||
Func { idx: ThunkIdx },
|
||||
/// push param `sym` into TOS
|
||||
PushIdentParam { sym: EcoString },
|
||||
/// push formal param `sym` into TOS
|
||||
PushFormalParam { sym: EcoString },
|
||||
/// push default formal param with thunkidx `idx` into TOS
|
||||
PushDefaultParam { idx: ThunkIdx },
|
||||
/// TODO:
|
||||
SetEllipsis,
|
||||
/// TODO:
|
||||
SetAlias { sym: EcoString },
|
||||
|
||||
/// consume 1 element, assert TOS is true
|
||||
Assert,
|
||||
|
||||
Reference in New Issue
Block a user