chore: fmt
This commit is contained in:
@@ -4,17 +4,7 @@ use crate::ty::internal::{Const, Func};
|
||||
|
||||
type Slice<T> = Box<[T]>;
|
||||
|
||||
pub type ThunkIdx = usize;
|
||||
pub type FuncIdx = usize;
|
||||
pub type OpCodes = Slice<OpCode>;
|
||||
pub type Consts = Slice<Const>;
|
||||
pub type Thunks = Slice<Thunk>;
|
||||
pub type Funcs = Slice<Func>;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Thunk {
|
||||
pub opcodes: OpCodes,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum OpCode {
|
||||
@@ -23,9 +13,9 @@ pub enum OpCode {
|
||||
/// load a dynamic var onto stack
|
||||
LookUp { sym: EcoString },
|
||||
/// load a thunk lazily onto stack
|
||||
LoadThunk { idx: ThunkIdx },
|
||||
LoadThunk { idx: usize },
|
||||
/// load a thunk onto stack and force its value
|
||||
LoadValue { idx: ThunkIdx },
|
||||
LoadValue { idx: usize },
|
||||
/// force TOS to value
|
||||
ForceValue,
|
||||
|
||||
@@ -33,7 +23,7 @@ pub enum OpCode {
|
||||
/// Example: __add 1 2 => [ LookUp("__add") Const(1) Const(2) Call(2) ]
|
||||
Call { arity: usize },
|
||||
/// make a function
|
||||
Func { idx: ThunkIdx },
|
||||
Func { idx: usize },
|
||||
|
||||
/// consume 1 element, assert TOS is true
|
||||
Assert,
|
||||
@@ -107,6 +97,6 @@ pub enum UnOp {
|
||||
#[derive(Debug)]
|
||||
pub struct Program {
|
||||
pub top_level: OpCodes,
|
||||
pub thunks: Thunks,
|
||||
pub funcs: Box<[Func]>
|
||||
pub thunks: Slice<OpCodes>,
|
||||
pub funcs: Slice<Func>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user