Skip to main content

Opcode

Enum Opcode 

Source
pub enum Opcode {
Show 67 variants PushNull, PushBool(bool), PushInt(i64), PushFloat(f64), PushStr(Arc<str>), PushRoot, PushCurrent, GetField(Arc<str>), GetIndex(i64), GetSlice(Option<i64>, Option<i64>), DynIndex(Arc<Program>), OptField(Arc<str>), Descendant(Arc<str>), DescendAll, InlineFilter(Arc<Program>), Quantifier(QuantifierKind), RootChain(Arc<[Arc<str>]>), FilterCount(Arc<Program>), FindFirst(Arc<Program>), FindOne(Arc<Program>), FilterMap { pred: Arc<Program>, map: Arc<Program>, }, FilterFilter { p1: Arc<Program>, p2: Arc<Program>, }, MapMap { f1: Arc<Program>, f2: Arc<Program>, }, MapSum(Arc<Program>), MapAvg(Arc<Program>), TopN { n: usize, asc: bool, }, MapFlatten(Arc<Program>), FilterTakeWhile { pred: Arc<Program>, stop: Arc<Program>, }, FilterDropWhile { pred: Arc<Program>, drop: Arc<Program>, }, MapUnique(Arc<Program>), EquiJoin { rhs: Arc<Program>, lhs_key: Arc<str>, rhs_key: Arc<str>, }, LoadIdent(Arc<str>), Add, Sub, Mul, Div, Mod, Eq, Neq, Lt, Lte, Gt, Gte, Fuzzy, Not, Neg, CastOp(CastType), AndOp(Arc<Program>), OrOp(Arc<Program>), CoalesceOp(Arc<Program>), CallMethod(Arc<CompiledCall>), CallOptMethod(Arc<CompiledCall>), MakeObj(Arc<[CompiledObjEntry]>), MakeArr(Arc<[Arc<Program>]>), FString(Arc<[CompiledFSPart]>), KindCheck { ty: KindType, negate: bool, }, SetCurrent, BindVar(Arc<str>), StoreVar(Arc<str>), BindObjDestructure(Arc<BindObjSpec>), BindArrDestructure(Arc<[Arc<str>]>), LetExpr { name: Arc<str>, body: Arc<Program>, }, ListComp(Arc<CompSpec>), DictComp(Arc<DictCompSpec>), SetComp(Arc<CompSpec>), GetPointer(Arc<str>), PatchEval(Arc<Expr>),
}

Variants§

§

PushNull

§

PushBool(bool)

§

PushInt(i64)

§

PushFloat(f64)

§

PushStr(Arc<str>)

§

PushRoot

§

PushCurrent

§

GetField(Arc<str>)

§

GetIndex(i64)

§

GetSlice(Option<i64>, Option<i64>)

§

DynIndex(Arc<Program>)

§

OptField(Arc<str>)

§

Descendant(Arc<str>)

§

DescendAll

§

InlineFilter(Arc<Program>)

§

Quantifier(QuantifierKind)

§

RootChain(Arc<[Arc<str>]>)

PushRoot + GetField* fused — resolves chain via pointer arithmetic.

§

FilterCount(Arc<Program>)

filter(pred) + len/count fused — counts matches without temp array.

§

FindFirst(Arc<Program>)

filter(pred) + First quantifier fused — early-exit on first match.

§

FindOne(Arc<Program>)

filter(pred) + One quantifier fused — early-exit at 2nd match (error).

§

FilterMap

filter(pred) + map(f) fused — single pass, no intermediate array.

Fields

§pred: Arc<Program>
§

FilterFilter

filter(p1) + filter(p2) fused — single pass, both predicates.

Fields

§

MapMap

map(f1) + map(f2) fused — single pass, composed.

Fields

§

MapSum(Arc<Program>)

Fused map(f).sum() — evaluates f per item, accumulates numeric sum.

§

MapAvg(Arc<Program>)

Fused map(f).avg() — evaluates f per item, computes mean as float.

§

TopN

Fused sort() + [0:n] — partial-sort smallest N using BinaryHeap. asc=true → smallest N; asc=false → largest N.

Fields

§asc: bool
§

MapFlatten(Arc<Program>)

Fused map(f).flatten() — single-pass concat of mapped arrays.

§

FilterTakeWhile

Fused filter(p).take_while(q) — scan while both predicates hold.

Fields

§pred: Arc<Program>
§stop: Arc<Program>
§

FilterDropWhile

Fused filter(p).drop_while(q) — skip leading matches of q on p-filtered elements.

Fields

§pred: Arc<Program>
§drop: Arc<Program>
§

MapUnique(Arc<Program>)

Fused map(f).unique() — apply f and dedup by resulting value.

§

EquiJoin

Fused equi-join: TOS is lhs array; rhs program evaluates to rhs array; join by (lhs_key, rhs_key) string field names. Produces array of merged objects (rhs wins on collision).

Fields

§lhs_key: Arc<str>
§rhs_key: Arc<str>
§

LoadIdent(Arc<str>)

§

Add

§

Sub

§

Mul

§

Div

§

Mod

§

Eq

§

Neq

§

Lt

§

Lte

§

Gt

§

Gte

§

Fuzzy

§

Not

§

Neg

§

CastOp(CastType)

§

AndOp(Arc<Program>)

§

OrOp(Arc<Program>)

§

CoalesceOp(Arc<Program>)

§

CallMethod(Arc<CompiledCall>)

§

CallOptMethod(Arc<CompiledCall>)

§

MakeObj(Arc<[CompiledObjEntry]>)

§

MakeArr(Arc<[Arc<Program>]>)

§

FString(Arc<[CompiledFSPart]>)

§

KindCheck

Fields

§negate: bool
§

SetCurrent

Pop TOS → env.current, then push it back (pass-through with context update).

§

BindVar(Arc<str>)

TOS → env var by name, TOS remains (for -> bind).

§

StoreVar(Arc<str>)

Pop TOS → env var (for let init).

§

BindObjDestructure(Arc<BindObjSpec>)

Object destructure bind: TOS obj → multiple vars.

§

BindArrDestructure(Arc<[Arc<str>]>)

Array destructure bind: TOS arr → multiple vars.

§

LetExpr

Fields

§name: Arc<str>
§body: Arc<Program>
§

ListComp(Arc<CompSpec>)

§

DictComp(Arc<DictCompSpec>)

§

SetComp(Arc<CompSpec>)

§

GetPointer(Arc<str>)

§

PatchEval(Arc<Expr>)

Trait Implementations§

Source§

impl Clone for Opcode

Source§

fn clone(&self) -> Opcode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Opcode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.