summaryrefslogtreecommitdiff
path: root/src/eval/class.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-17 15:47:54 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-17 17:32:56 +0100
commitc5e67af22bd6242366819879be84c10c4dd135be (patch)
treed857b99b26401d1b3b74c4cebacbf086c25bef40 /src/eval/class.rs
parent3d965ae6a479636a13b2e2f2344e8d97bedece1f (diff)
Merge eval and layout contexts into `Vm`
Diffstat (limited to 'src/eval/class.rs')
-rw-r--r--src/eval/class.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eval/class.rs b/src/eval/class.rs
index c4880e9a..28e49a99 100644
--- a/src/eval/class.rs
+++ b/src/eval/class.rs
@@ -1,7 +1,7 @@
use std::fmt::{self, Debug, Formatter, Write};
use std::hash::{Hash, Hasher};
-use super::{Args, EvalContext, Func, StyleMap, Template, Value};
+use super::{Args, Func, StyleMap, Template, Value, Vm};
use crate::diag::TypResult;
/// A class of nodes.
@@ -36,7 +36,7 @@ use crate::diag::TypResult;
#[derive(Clone)]
pub struct Class {
name: &'static str,
- construct: fn(&mut EvalContext, &mut Args) -> TypResult<Value>,
+ construct: fn(&mut Vm, &mut Args) -> TypResult<Value>,
set: fn(&mut Args, &mut StyleMap) -> TypResult<()>,
}
@@ -73,8 +73,8 @@ impl Class {
/// This parses both property and data arguments (in this order), styles the
/// template constructed from the data with the style properties and wraps
/// it in a value.
- pub fn construct(&self, ctx: &mut EvalContext, mut args: Args) -> TypResult<Value> {
- let value = (self.construct)(ctx, &mut args)?;
+ pub fn construct(&self, vm: &mut Vm, mut args: Args) -> TypResult<Value> {
+ let value = (self.construct)(vm, &mut args)?;
args.finish()?;
Ok(value)
}
@@ -117,7 +117,7 @@ pub trait Construct {
///
/// This is passed only the arguments that remain after execution of the
/// class's set rule.
- fn construct(ctx: &mut EvalContext, args: &mut Args) -> TypResult<Template>;
+ fn construct(vm: &mut Vm, args: &mut Args) -> TypResult<Template>;
}
/// Set style properties of a class.