diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-04 22:36:20 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-04 22:36:20 +0200 |
| commit | 605ab104c5e041c345007020d277b4c6267debe6 (patch) | |
| tree | c18f3333a0c0e0527ad1039a498cb210300f7fd9 /src/eval/mod.rs | |
| parent | ef8aa763faa59fd62c90c6d6245e8d2c5eece35e (diff) | |
Better argument parsing 🥙
Diffstat (limited to 'src/eval/mod.rs')
| -rw-r--r-- | src/eval/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs index 3796669b..4ec29056 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -1,10 +1,14 @@ //! Evaluation of syntax trees. +mod args; +mod convert; mod dict; mod scope; mod state; mod value; +pub use args::*; +pub use convert::*; pub use dict::*; pub use scope::*; pub use state::*; @@ -88,9 +92,10 @@ impl Eval for ExprCall { async fn eval(&self, ctx: &mut LayoutContext) -> Self::Output { let name = &self.name.v; let span = self.name.span; - let args = self.args.eval(ctx).await; + let dict = self.args.v.eval(ctx).await; if let Some(func) = ctx.state.scope.get(name) { + let args = Args(dict.span_with(self.args.span)); ctx.f.decos.push(Deco::Resolved.span_with(span)); (func.clone())(args, ctx).await } else { @@ -98,7 +103,7 @@ impl Eval for ExprCall { error!(@ctx.f, span, "unknown function"); ctx.f.decos.push(Deco::Unresolved.span_with(span)); } - Value::Dict(args) + Value::Dict(dict) } } } |
