summaryrefslogtreecommitdiff
path: root/src/eval/convert.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-04 23:31:35 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-04 23:31:35 +0200
commit335fa2d118718b4dba539294a8ef6c96c5bbf09e (patch)
tree08e48d0c18c350bc9479d0d801d2320628d8e4a2 /src/eval/convert.rs
parent605ab104c5e041c345007020d277b4c6267debe6 (diff)
Small improvements 🍪
Diffstat (limited to 'src/eval/convert.rs')
-rw-r--r--src/eval/convert.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/eval/convert.rs b/src/eval/convert.rs
index a32d5912..4c177c5b 100644
--- a/src/eval/convert.rs
+++ b/src/eval/convert.rs
@@ -4,11 +4,12 @@ use std::ops::Deref;
use fontdock::{FontStretch, FontStyle, FontWeight};
-use super::*;
+use super::{Value, ValueDict, ValueFunc};
use crate::diag::Diag;
use crate::geom::Linear;
use crate::layout::{Dir, SpecAlign};
use crate::paper::Paper;
+use crate::syntax::{Ident, SpanWith, Spanned, SynTree};
/// Types that values can be converted into.
pub trait Convert: Sized {
@@ -96,9 +97,9 @@ macro_rules! impl_match {
}
impl_match!(Value, "value", v => v);
-impl_match!(Ident, "ident", Value::Ident(v) => v);
+impl_match!(Ident, "identifier", Value::Ident(v) => v);
impl_match!(bool, "bool", Value::Bool(v) => v);
-impl_match!(i64, "int", Value::Int(v) => v);
+impl_match!(i64, "integer", Value::Int(v) => v);
impl_match!(f64, "float",
Value::Int(v) => v as f64,
Value::Float(v) => v,
@@ -112,9 +113,9 @@ impl_match!(Linear, "linear",
);
impl_match!(String, "string", Value::Str(v) => v);
impl_match!(SynTree, "tree", Value::Content(v) => v);
-impl_match!(ValueDict, "dict", Value::Dict(v) => v);
+impl_match!(ValueDict, "dictionary", Value::Dict(v) => v);
impl_match!(ValueFunc, "function", Value::Func(v) => v);
-impl_match!(StringLike, "ident or string",
+impl_match!(StringLike, "identifier or string",
Value::Ident(Ident(v)) => StringLike(v),
Value::Str(v) => StringLike(v),
);