[][src]Enum nyar_valkyrie::AST

pub enum AST {
    Program(Vec<AST>),
    Suite(Vec<AST>),
    EmptyStatement,
    ImportStatement {
        data: ImportStatement,
        annotations: Option<Box<AST>>,
    },
    IfStatement {
        pairs: Vec<(AST, AST)>,
        default: Option<Box<AST>>,
        annotations: Option<Box<AST>>,
    },
    LetBinding {
        symbol: Box<AST>,
        modifiers: Vec<String>,
        types: Box<AST>,
        annotations: Option<Box<AST>>,
    },
    Expression {
        base: Box<AST>,
        eos: bool,
        pos: Position,
        annotations: Option<Box<AST>>,
    },
    TypeExpression {
        base: Box<AST>,
        pos: Position,
        annotations: Option<Box<AST>>,
    },
    UnaryOperators {
        base: Box<AST>,
        prefix: Vec<String>,
        suffix: Vec<String>,
        pos: Position,
    },
    InfixOperators {
        o: String,
        lhs: Box<AST>,
        rhs: Box<AST>,
        pos: Position,
    },
    ListExpression(Vec<AST>),
    TupleExpression(Vec<AST>),
    SliceExpression {
        base: Box<AST>,
        list: Vec<AST>,
    },
    IndexExpression(IndexExpression),
    ApplyExpression {
        base: Box<AST>,
        types: Vec<AST>,
        args: Vec<AST>,
        kv_pairs: Vec<(AST, AST)>,
        pos: Position,
    },
    Symbol {
        name: String,
        scope: Vec<String>,
    },
    NumberLiteral {
        handler: String,
        data: String,
    },
    Number(Number),
    StringLiteral {
        handler: String,
        data: String,
    },
    String(String),
    CommentLiteral {
        handler: String,
        data: String,
    },
    Boolean(bool),
    None,
}

Variants

Program(Vec<AST>)
Suite(Vec<AST>)
EmptyStatement
  • EmptyStatement: Skip
ImportStatement
  • ImportStatement

Fields of ImportStatement

data: ImportStatementannotations: Option<Box<AST>>
IfStatement

Fields of IfStatement

pairs: Vec<(AST, AST)>default: Option<Box<AST>>annotations: Option<Box<AST>>
LetBinding

Fields of LetBinding

symbol: Box<AST>modifiers: Vec<String>types: Box<AST>annotations: Option<Box<AST>>
Expression
  • Expression

Fields of Expression

base: Box<AST>eos: boolpos: Positionannotations: Option<Box<AST>>
TypeExpression
  • Expression

Fields of TypeExpression

base: Box<AST>pos: Positionannotations: Option<Box<AST>>
UnaryOperators
  • UnaryOperators
  • base

Fields of UnaryOperators

base: Box<AST>prefix: Vec<String>suffix: Vec<String>pos: Position
InfixOperators
  • InfixOperators

Fields of InfixOperators

o: Stringlhs: Box<AST>rhs: Box<AST>pos: Position
ListExpression(Vec<AST>)
TupleExpression(Vec<AST>)
SliceExpression
  • SliceExpression the terms must IndexExpression

Fields of SliceExpression

base: Box<AST>list: Vec<AST>
IndexExpression(IndexExpression)
ApplyExpression

Fields of ApplyExpression

base: Box<AST>types: Vec<AST>args: Vec<AST>kv_pairs: Vec<(AST, AST)>pos: Position
Symbol
  • Symbol

Fields of Symbol

name: Stringscope: Vec<String>
NumberLiteral
  • Number: raw number represent

Fields of NumberLiteral

handler: Stringdata: String
Number(Number)
StringLiteral

Fields of StringLiteral

handler: Stringdata: String
String(String)
  • String: raw string
CommentLiteral
  • Comment: raw comment with handler

Fields of CommentLiteral

handler: Stringdata: String
Boolean(bool)
None
  • None: It doesn't look like anything to me

Methods

impl AST[src]

pub fn save(&self, path: &str) -> Result<(), Error>[src]

pub fn load(path: &str) -> AST[src]

pub fn set_base(self, replace: AST) -> AST[src]

Trait Implementations

impl Clone for AST[src]

impl Debug for AST[src]

impl<'de> Deserialize<'de> for AST[src]

impl PartialEq<AST> for AST[src]

impl Serialize for AST[src]

impl StructuralPartialEq for AST[src]

Auto Trait Implementations

impl RefUnwindSafe for AST

impl Send for AST

impl Sync for AST

impl Unpin for AST

impl UnwindSafe for AST

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.