summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/func.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/eval/func.rs b/src/eval/func.rs
index 8243b4f6..6f98e316 100644
--- a/src/eval/func.rs
+++ b/src/eval/func.rs
@@ -54,15 +54,11 @@ impl Func {
/// Create a new function from a native rust node.
pub fn from_node<T: Node>(mut info: FuncInfo) -> Self {
- info.params.extend(T::properties());
+ info.params.extend(T::params());
Self(
Arc::new(Prehashed::new(Repr::Native(Native {
- func: |ctx, args| {
- let styles = T::set(args, true)?;
- let content = T::construct(ctx, args)?;
- Ok(Value::Content(content.styled_with_map(styles.scoped())))
- },
- set: Some(|args| T::set(args, false)),
+ func: |vm, args| T::construct(vm, args).map(Value::Content),
+ set: Some(T::set),
node: Some(NodeId::of::<T>()),
info,
}))),
@@ -281,10 +277,10 @@ pub struct ParamInfo {
/// Can be true even if `positional` is true if the parameter can be given
/// in both variants.
pub named: bool,
- /// Is the parameter required?
- pub required: bool,
/// Can the parameter be given any number of times?
pub variadic: bool,
+ /// Is the parameter required?
+ pub required: bool,
/// Is the parameter settable with a set rule?
pub settable: bool,
}