Debug ast rewrite
This commit is contained in:
@@ -72,6 +72,12 @@ impl Expression {
|
||||
&BinExp(ref binop, ref lhs, ref rhs) => binop.reduce(lhs, rhs),
|
||||
&PrefixExp(ref op, ref arg) => op.reduce(arg),
|
||||
&Value(ref name) => Expr::Val(name.clone()),
|
||||
/*
|
||||
&Call { ref f, ref arguments } => Expr::Call {
|
||||
f: Box<Expression>,
|
||||
arguments: Vec<Expression>,
|
||||
},
|
||||
*/
|
||||
e => Expr::UnimplementedSigilValue,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ fn typechecking(handle: &mut Schala, input: parsing::AST, comp: Option<&mut Unfi
|
||||
type TempASTReduction = (ast_reducing::ReducedAST, parsing::AST);
|
||||
fn ast_reducing(handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result<TempASTReduction, String> {
|
||||
let output = input.reduce();
|
||||
comp.map(|comp| comp.add_artifact(TraceArtifact::new("ast_reducing", format!("{:?}", output))));
|
||||
Ok((output, input))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user