compose-idents 0.3.0

A Rust macro for generating new identifiers (names of variables, functions, traits, etc) by concatenating one or more arbitrary parts and applying other manipulations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::ast::{Expr, ExprKind};
use crate::core::Environment;
use crate::error::Error;
use crate::eval::{Context, Eval, Evaluated};
use std::ops::Deref;

impl Eval for Expr {
    fn eval(&self, environment: &Environment, context: &mut Context) -> Result<Evaluated, Error> {
        match self.kind() {
            ExprKind::ValueExpr(value) => value.deref().eval(environment, context),
            ExprKind::FuncCallExpr(value) => value.eval(environment, context),
        }
    }
}