From 5de791d9e6a1006dc6a017ec8e20a1c70a91a780 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 15 Sep 2021 12:43:57 +0200 Subject: Rename `SyntaxTree` to `Markup` Also `SyntaxNode` -> `MarkupNode`. --- src/eval/mod.rs | 10 +++++----- src/eval/walk.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/eval') 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 { +pub fn eval(ctx: &mut Context, source: SourceId, markup: &Markup) -> TypResult { 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; } -impl Eval for SyntaxTree { +impl Eval for Markup { type Output = Template; fn eval(&self, ctx: &mut EvalContext) -> TypResult { @@ -253,7 +253,7 @@ impl Eval for TemplateExpr { type Output = Template; fn eval(&self, ctx: &mut EvalContext) -> TypResult { - 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(), -- cgit v1.2.3