rual-core 0.0.4

A slim, embeddable language
Documentation
use crate::syntax::Punct;

type StrRange = (usize, usize);

#[derive(Copy, Clone, PartialEq, Debug)]
pub enum Value {
    Unit,
    Num(i32),
    Str(StrRange),
}

#[derive(Clone, PartialEq, Debug)]
pub enum Expr {
    Declaration {
        name: StrRange,
        val: Box<Expr>,
    },
    FunctionDeclaration {
        name: StrRange,
        params: Vec<StrRange>,
        body: Box<Expr>,
    },
    FunctionCall {
        name: StrRange,
        args: Vec<Expr>,
    },
    Multiple(Vec<Expr>),
    Range {
        from: Box<Expr>,
        to: Box<Expr>,
    },
    IdentLookup(StrRange),

    // A reverse Polish notation expression
    Rpn(Vec<Expr>),
    Value(Value),
    Op(Punct),
}