diff options
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/mod.rs | 10 | ||||
| -rw-r--r-- | src/eval/walk.rs | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs index d88dd2bb..9fe86ebe 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -1,4 +1,4 @@ -//! Evaluation of syntax trees into modules. +//! Evaluation of markup into modules. #[macro_use] mod array; @@ -46,9 +46,9 @@ use crate::util::RefMutExt; use crate::Context; /// Evaluate a parsed source file into a module. -pub fn eval(ctx: &mut Context, source: SourceId, ast: &SyntaxTree) -> TypResult<Module> { +pub fn eval(ctx: &mut Context, source: SourceId, markup: &Markup) -> TypResult<Module> { let mut ctx = EvalContext::new(ctx, source); - let template = ast.eval(&mut ctx)?; + let template = markup.eval(&mut ctx)?; Ok(Module { scope: ctx.scopes.top, template }) } @@ -159,7 +159,7 @@ pub trait Eval { fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output>; } -impl Eval for SyntaxTree { +impl Eval for Markup { type Output = Template; fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output> { @@ -253,7 +253,7 @@ impl Eval for TemplateExpr { type Output = Template; fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output> { - self.tree.eval(ctx) + self.body.eval(ctx) } } diff --git a/src/eval/walk.rs b/src/eval/walk.rs index 3b9fc094..1755dab9 100644 --- a/src/eval/walk.rs +++ b/src/eval/walk.rs @@ -7,13 +7,13 @@ use crate::layout::{ParChild, ParNode, StackChild, StackNode}; use crate::syntax::*; use crate::util::BoolExt; -/// Walk a syntax node and fill the currently built template. +/// Walk markup, filling the currently built template. pub trait Walk { /// Walk the node. fn walk(&self, ctx: &mut EvalContext) -> TypResult<()>; } -impl Walk for SyntaxTree { +impl Walk for Markup { fn walk(&self, ctx: &mut EvalContext) -> TypResult<()> { for node in self.iter() { node.walk(ctx)?; @@ -22,7 +22,7 @@ impl Walk for SyntaxTree { } } -impl Walk for SyntaxNode { +impl Walk for MarkupNode { fn walk(&self, ctx: &mut EvalContext) -> TypResult<()> { match self { Self::Space => ctx.template.space(), |
