Skip to main content

JuliaStmt

Enum JuliaStmt 

Source
pub enum JuliaStmt {
Show 25 variants Expr(JuliaExpr), Assign(JuliaExpr, JuliaExpr), AugAssign(JuliaExpr, String, JuliaExpr), Local(String, Option<JuliaType>, Option<JuliaExpr>), Global(String), Const(String, Option<JuliaType>, JuliaExpr), Return(Option<JuliaExpr>), Break, Continue, If { cond: JuliaExpr, then_body: Vec<JuliaStmt>, elseif_branches: Vec<(JuliaExpr, Vec<JuliaStmt>)>, else_body: Option<Vec<JuliaStmt>>, }, For { vars: Vec<String>, iter: JuliaExpr, body: Vec<JuliaStmt>, }, While { cond: JuliaExpr, body: Vec<JuliaStmt>, }, TryCatch { try_body: Vec<JuliaStmt>, catch_var: Option<String>, catch_body: Vec<JuliaStmt>, finally_body: Option<Vec<JuliaStmt>>, }, FunctionDef(JuliaFunction), StructDef(JuliaStruct), AbstractTypeDef { name: String, type_params: Vec<String>, supertype: Option<String>, }, PrimitiveTypeDef { name: String, bits: u32, supertype: Option<String>, }, ModuleDef(JuliaModule), Using(Vec<String>), Import(String, Vec<String>), Export(Vec<String>), Include(String), MacroDef { name: String, params: Vec<String>, body: Vec<JuliaStmt>, }, Comment(String), Blank,
}
Expand description

Julia statement.

Variants§

§

Expr(JuliaExpr)

Expression statement: expr

§

Assign(JuliaExpr, JuliaExpr)

Local assignment: x = expr

§

AugAssign(JuliaExpr, String, JuliaExpr)

Augmented assignment: x += expr

§

Local(String, Option<JuliaType>, Option<JuliaExpr>)

Local variable declaration: local x::T = expr

§

Global(String)

Global variable declaration: global x

§

Const(String, Option<JuliaType>, JuliaExpr)

Const declaration: const x = expr

§

Return(Option<JuliaExpr>)

Return statement: return expr

§

Break

Break statement: break

§

Continue

Continue statement: continue

§

If

If/elseif/else statement

Fields

§then_body: Vec<JuliaStmt>
§elseif_branches: Vec<(JuliaExpr, Vec<JuliaStmt>)>
§else_body: Option<Vec<JuliaStmt>>
§

For

For loop: for x in iter

Fields

§vars: Vec<String>
§

While

While loop: while cond

Fields

§

TryCatch

Try/catch/finally block

Fields

§try_body: Vec<JuliaStmt>
§catch_var: Option<String>
§catch_body: Vec<JuliaStmt>
§finally_body: Option<Vec<JuliaStmt>>
§

FunctionDef(JuliaFunction)

Function definition (see JuliaFunction)

§

StructDef(JuliaStruct)

Struct definition (see JuliaStruct)

§

AbstractTypeDef

Abstract type definition: abstract type Foo <: Bar end

Fields

§name: String
§type_params: Vec<String>
§supertype: Option<String>
§

PrimitiveTypeDef

Primitive type definition: primitive type Foo 64 end

Fields

§name: String
§bits: u32
§supertype: Option<String>
§

ModuleDef(JuliaModule)

Module definition

§

Using(Vec<String>)

Using statement: using Module

§

Import(String, Vec<String>)

Import statement: import Module: sym1, sym2

§

Export(Vec<String>)

Export statement: export sym1, sym2

§

Include(String)

Include statement: include("file.jl")

§

MacroDef

Macro definition: macro name(args...) body end

Fields

§name: String
§params: Vec<String>
§

Comment(String)

Line comment: # comment

§

Blank

Empty line

Trait Implementations§

Source§

impl Clone for JuliaStmt

Source§

fn clone(&self) -> JuliaStmt

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 JuliaStmt

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for JuliaStmt

Source§

fn eq(&self, other: &JuliaStmt) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for JuliaStmt

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.