[][src]Trait libslide::grammar::mem::RcExpression

pub trait RcExpression where
    Self: Deref + Ord + Clone
{ type Inner; fn is_const(&self) -> bool;
fn is_var(&self) -> bool;
fn paren(inner: Self, span: Span) -> Self;
fn bracket(inner: Self, span: Span) -> Self;
fn binary(expr: BinaryExpr<Self>, span: Span) -> Self;
fn unary(expr: UnaryExpr<Self>, span: Span) -> Self;
fn empty(span: Span) -> Self;
fn span(&self) -> Span; }

Describes a reference-counted slide expression.

Associated Types

type Inner

The type of expression held by Self.

Loading content...

Required methods

fn is_const(&self) -> bool

Returns whether the expression is a statically-evaluatable constant.

fn is_var(&self) -> bool

Returns whether the expression is a terminable variable (or variable-like).

fn paren(inner: Self, span: Span) -> Self

Paranthesizes inner.

fn bracket(inner: Self, span: Span) -> Self

Brackets inner.

fn binary(expr: BinaryExpr<Self>, span: Span) -> Self

Creates an RcExpression from a BinaryExpr.

fn unary(expr: UnaryExpr<Self>, span: Span) -> Self

Creates an RcExpression from a UnaryExpr.

fn empty(span: Span) -> Self

Returns an empty expression.

fn span(&self) -> Span

Returns the span of the expression.

Loading content...

Implementors

impl RcExpression for RcExprPat[src]

type Inner = ExprPat

impl RcExpression for RcExpr[src]

type Inner = Expr

Loading content...