Croissant Runtime
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
crsn/crsn_buf/src/defs.rs

31 lines
752 B

use crsn::asm::data::{Rd, RdObj, Wr};
#[derive(Clone, Debug, PartialEq)]
pub enum BufValue {
Zeros(Rd),
Values(Vec<Rd>),
Chars(String),
}
#[derive(Clone, Debug, PartialEq)]
pub enum BufOps {
New { dst: Wr, value: BufValue },
// Elementary ops
Read { dst: Wr, obj: RdObj, idx: Rd },
GetLen { dst: Wr, obj: RdObj },
Write { obj: RdObj, idx: Rd, value: Rd },
Insert { obj: RdObj, idx: Rd, value: Rd },
Remove { dst: Wr, obj: RdObj, idx: Rd },
// Whole buffer ops
Resize { obj: RdObj, len: Rd },
Reverse { obj: RdObj },
AppendBuf { obj: RdObj, obj2: RdObj },
PrependBuf { obj: RdObj, obj2: RdObj },
// Stack-style ops
Push { obj: RdObj, src: Rd },
Pop { dst: Wr, obj: RdObj },
}