Files
Cagire/crates/forth/src/ops.rs
2026-01-27 13:40:52 +01:00

93 lines
1.2 KiB
Rust

use super::types::SourceSpan;
#[derive(Clone, Debug, PartialEq)]
pub enum Op {
PushInt(i64, Option<SourceSpan>),
PushFloat(f64, Option<SourceSpan>),
PushStr(String, Option<SourceSpan>),
Dup,
Dupn,
Drop,
Swap,
Over,
Rot,
Nip,
Tuck,
Add,
Sub,
Mul,
Div,
Mod,
Neg,
Abs,
Floor,
Ceil,
Round,
Min,
Max,
Pow,
Sqrt,
Sin,
Cos,
Log,
Eq,
Ne,
Lt,
Gt,
Le,
Ge,
And,
Or,
Not,
Xor,
Nand,
Nor,
IfElse,
Pick,
BranchIfZero(usize, Option<SourceSpan>, Option<SourceSpan>),
Branch(usize),
NewCmd,
SetParam(String),
Emit,
Silence,
Get,
Set,
GetContext(String),
Rand,
Seed,
Cycle,
Choose,
ChanceExec,
ProbExec,
Coin,
Mtof,
Ftom,
ListStart,
ListEnd,
ListEndCycle,
PCycle,
ListEndPCycle,
Scale,
SetTempo,
Every,
Quotation(Vec<Op>, Option<SourceSpan>),
When,
Unless,
Adsr,
Ad,
Apply,
Ramp,
Tri,
Range,
Perlin,
Chain,
Loop,
Degree(&'static [i64]),
Oct,
DivStart,
DivEnd,
StackStart,
EmitN,
ClearCmd,
}