29 lines
522 B
Rust
29 lines
522 B
Rust
//! The Rush scripting language.
|
|
|
|
use super::{
|
|
Result,
|
|
env::Env,
|
|
};
|
|
|
|
/// The value of an expression.
|
|
pub enum Value {
|
|
String (String)
|
|
}
|
|
|
|
/// An identifier.
|
|
pub struct Name (String);
|
|
|
|
/// Evaluation of expressions in the Rush scripting language.
|
|
pub trait Eval {
|
|
|
|
/// Evaluates the code in the context of the given [`Env`].
|
|
fn eval <E> (self, env: &E) -> Result<Value>
|
|
where
|
|
E: Env;
|
|
|
|
}
|
|
|
|
/// An iterator of parsed code generated from an iterator of raw
|
|
/// code fragments.
|
|
pub struct Parser;
|