diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-17 22:04:18 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-17 22:20:37 +0200 |
| commit | 594809e35b9e768f1a50926cf5e7a9df41ba7d16 (patch) | |
| tree | 488f201599a67329d7916b9b3ecb73dd27ad24d7 /src/eval/value.rs | |
| parent | c53d98a22f367a9eecfb45d1b22f1be5c6cf908d (diff) | |
Library functions behave more imperatively
- Templates scope state changes
- State-modifying function operate in place instead of returning a template
- Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map
- No more wide calls
Diffstat (limited to 'src/eval/value.rs')
| -rw-r--r-- | src/eval/value.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/eval/value.rs b/src/eval/value.rs index 62899cc1..99efc2e5 100644 --- a/src/eval/value.rs +++ b/src/eval/value.rs @@ -3,10 +3,9 @@ use std::cmp::Ordering; use std::fmt::{self, Debug, Display, Formatter}; use std::rc::Rc; -use super::{ops, Array, Dict, Function, Str, Template, TemplateFunc}; +use super::{ops, Array, Dict, Function, Str, Template}; use crate::color::{Color, RgbaColor}; use crate::diag::StrResult; -use crate::exec::ExecContext; use crate::geom::{Angle, Fractional, Length, Linear, Relative}; use crate::syntax::Spanned; use crate::util::EcoString; @@ -51,14 +50,6 @@ pub enum Value { } impl Value { - /// Create a new template consisting of a single function node. - pub fn template<F>(f: F) -> Self - where - F: Fn(&mut ExecContext) + 'static, - { - Self::Template(TemplateFunc::new(f).into()) - } - /// The name of the stored value's type. pub fn type_name(&self) -> &'static str { match self { |
