Files
Cagire/crates/forth/src/ops.rs

106 lines
1.4 KiB
Rust

use std::sync::Arc;
use super::types::SourceSpan;
#[derive(Clone, Debug, PartialEq)]
pub enum Op {
PushInt(i64, Option<SourceSpan>),
PushFloat(f64, Option<SourceSpan>),
PushStr(Arc<str>, Option<SourceSpan>),
Dup,
Dupn,
Drop,
Swap,
Over,
Rot,
Nip,
Tuck,
Dup2,
Drop2,
Swap2,
Over2,
Forget,
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,
Get,
Set,
GetContext(String),
Rand,
ExpRand,
LogRand,
Seed,
Cycle,
PCycle,
Choose,
ChanceExec,
ProbExec,
Coin,
Mtof,
Ftom,
SetTempo,
Every,
Quotation(Arc<[Op]>, Option<SourceSpan>),
When,
Unless,
Adsr,
Ad,
Apply,
Ramp,
Tri,
Range,
Perlin,
Chain,
Loop,
Degree(&'static [i64]),
Oct,
ClearCmd,
SetSpeed,
At,
IntRange,
Generate,
GeomRange,
Times,
Chord(&'static [i64]),
// MIDI
MidiEmit,
GetMidiCC,
MidiClock,
MidiStart,
MidiStop,
MidiContinue,
}