Skip to main content

Action

Enum Action 

Source
pub enum Action {
    SetGlobalVariable {
        variable: GlobalVarId,
        value: ValueId,
        span: Option<Span>,
        target_span: Option<Span>,
    },
    ModifyGlobalVariable {
        variable: GlobalVarId,
        op: ModifyOp,
        value: ValueId,
        span: Option<Span>,
        target_span: Option<Span>,
    },
    SetPlayerVariable {
        player: ValueId,
        variable: PlayerVarId,
        value: ValueId,
        span: Option<Span>,
        target_span: Option<Span>,
    },
    ModifyPlayerVariable {
        player: ValueId,
        variable: PlayerVarId,
        op: ModifyOp,
        value: ValueId,
        span: Option<Span>,
        target_span: Option<Span>,
    },
    AssignMember {
        target: ValueId,
        op: Option<ModifyOp>,
        value: ValueId,
        span: Option<Span>,
    },
    CallSubroutine {
        subroutine: SubroutineId,
        span: Option<Span>,
        callee_span: Option<Span>,
    },
    If {
        branches: Vec<IfBranch>,
        else_body: Option<Vec<ActionId>>,
        span: Option<Span>,
    },
    While {
        condition: ValueId,
        body: Vec<ActionId>,
        span: Option<Span>,
    },
    ForGlobalVariable {
        variable: GlobalVarId,
        start: ValueId,
        stop: ValueId,
        step: ValueId,
        body: Vec<ActionId>,
        span: Option<Span>,
        target_span: Option<Span>,
    },
    ForPlayerVariable {
        player: ValueId,
        variable: PlayerVarId,
        start: ValueId,
        stop: ValueId,
        step: ValueId,
        body: Vec<ActionId>,
        span: Option<Span>,
    },
    Call {
        name: String,
        args: Vec<ValueId>,
        span: Option<Span>,
    },
}
Expand description

A workshop action.

Variants§

§

SetGlobalVariable

Fields

§variable: GlobalVarId
§value: ValueId
§span: Option<Span>
§target_span: Option<Span>

The exact span of the assigned variable identifier.

§

ModifyGlobalVariable

Fields

§variable: GlobalVarId
§value: ValueId
§span: Option<Span>
§target_span: Option<Span>

The exact span of the modified variable identifier.

§

SetPlayerVariable

Fields

§player: ValueId
§variable: PlayerVarId
§value: ValueId
§span: Option<Span>
§target_span: Option<Span>

The exact span of the assigned variable identifier.

§

ModifyPlayerVariable

Fields

§player: ValueId
§variable: PlayerVarId
§value: ValueId
§span: Option<Span>
§target_span: Option<Span>

The exact span of the modified variable identifier.

§

AssignMember

Assignment to a canonical Workshop member-access target, optionally indexed. This is not a builtin catalog action; the emitter preserves the native member-assignment syntax.

Fields

§target: ValueId
§value: ValueId
§span: Option<Span>
§

CallSubroutine

Fields

§subroutine: SubroutineId
§span: Option<Span>
§callee_span: Option<Span>

The exact span of the callee identifier occurrence.

§

If

Fields

§branches: Vec<IfBranch>
§else_body: Option<Vec<ActionId>>
§span: Option<Span>
§

While

Fields

§condition: ValueId
§span: Option<Span>
§

ForGlobalVariable

Fields

§variable: GlobalVarId
§start: ValueId
§stop: ValueId
§step: ValueId
§span: Option<Span>
§target_span: Option<Span>

The exact span of the loop variable identifier.

§

ForPlayerVariable

For Player Variable(player, name, start, stop, step): the per-player loop form (frontend-neutral; parsed from reference evidence, not emitted by Wright’s own lowering, which models foreach counters as globals under the declared #119 contract).

Fields

§player: ValueId
§variable: PlayerVarId
§start: ValueId
§stop: ValueId
§step: ValueId
§span: Option<Span>
§

Call

Any other action call with side effects.

Fields

§name: String
§args: Vec<ValueId>
§span: Option<Span>

Implementations§

Source§

impl Action

Source

pub fn span(&self) -> Option<Span>

The source span of this action, if any.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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.