summaryrefslogtreecommitdiff
path: root/src/eval/args.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-07 17:07:44 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-07 17:07:44 +0200
commit537545e7f8351d7677c396456e46568f5a5e2a7a (patch)
treef4c7614293246db06c7fa7496458da01b15c3b84 /src/eval/args.rs
parentca1256c924f3672feb76dbc2bc2e309eb4fc4cf5 (diff)
Evaluation and node-based layouting 🚀
Diffstat (limited to 'src/eval/args.rs')
-rw-r--r--src/eval/args.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/eval/args.rs b/src/eval/args.rs
index d11deac6..04f83b50 100644
--- a/src/eval/args.rs
+++ b/src/eval/args.rs
@@ -2,8 +2,7 @@
use std::mem;
-use super::{Convert, RefKey, ValueDict};
-use crate::layout::LayoutContext;
+use super::{Convert, EvalContext, RefKey, ValueDict};
use crate::syntax::{SpanWith, Spanned};
/// A wrapper around a dictionary value that simplifies argument parsing in
@@ -16,7 +15,7 @@ impl Args {
///
/// Generates an error if the key exists, but the value can't be converted
/// into the type `T`.
- pub fn get<'a, K, T>(&mut self, ctx: &mut LayoutContext, key: K) -> Option<T>
+ pub fn get<'a, K, T>(&mut self, ctx: &mut EvalContext, key: K) -> Option<T>
where
K: Into<RefKey<'a>>,
T: Convert,
@@ -37,7 +36,7 @@ impl Args {
/// [`get`]: #method.get
pub fn need<'a, K, T>(
&mut self,
- ctx: &mut LayoutContext,
+ ctx: &mut EvalContext,
key: K,
name: &str,
) -> Option<T>
@@ -126,7 +125,7 @@ impl Args {
}
/// Generated _unexpected argument_ errors for all remaining entries.
- pub fn done(&self, ctx: &mut LayoutContext) {
+ pub fn done(&self, ctx: &mut EvalContext) {
for entry in self.0.v.values() {
let span = entry.key_span.join(entry.value.span);
ctx.diag(error!(span, "unexpected argument"));