conlang: Add Quote expression as a hack for testing
Possibly removed later, or replaced with something that turns Conlang AST nodes into Conlang data structures.
This commit is contained in:
@@ -147,6 +147,7 @@ impl Interpret for ExprKind {
|
||||
fn interpret(&self, env: &mut Environment) -> IResult<ConValue> {
|
||||
match self {
|
||||
ExprKind::Empty => Ok(ConValue::Empty),
|
||||
ExprKind::Quote(q) => q.interpret(env),
|
||||
ExprKind::Let(v) => v.interpret(env),
|
||||
ExprKind::Assign(v) => v.interpret(env),
|
||||
ExprKind::Modify(v) => v.interpret(env),
|
||||
@@ -174,6 +175,13 @@ impl Interpret for ExprKind {
|
||||
}
|
||||
}
|
||||
|
||||
impl Interpret for Quote {
|
||||
fn interpret(&self, _env: &mut Environment) -> IResult<ConValue> {
|
||||
// TODO: squoosh down into a ConValue?
|
||||
Ok(ConValue::Quote(self.quote.clone()))
|
||||
}
|
||||
}
|
||||
|
||||
mod assignment {
|
||||
/// Pattern matching engine for assignment
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user