diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-07 21:24:36 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-08 00:20:48 +0100 |
| commit | e74ae6ce70d4c6ca006613eadf07f920951789e3 (patch) | |
| tree | 0b9b2ddabf79dad8d55631780ee5d70afe7362d7 /src/eval/mod.rs | |
| parent | 0b624390906e911bde325b487b2710b67c8205c8 (diff) | |
Make all nodes into classes
Diffstat (limited to 'src/eval/mod.rs')
| -rw-r--r-- | src/eval/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs index e8c8fcd2..c16c2208 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -248,7 +248,7 @@ impl Eval for ListNode { fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output> { Ok(Node::block(library::ListNode { child: self.body().eval(ctx)?.into_block(), - labelling: library::Unordered, + kind: library::Unordered, })) } } @@ -259,7 +259,7 @@ impl Eval for EnumNode { fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output> { Ok(Node::block(library::ListNode { child: self.body().eval(ctx)?.into_block(), - labelling: library::Ordered(self.number()), + kind: library::Ordered(self.number()), })) } } @@ -450,6 +450,7 @@ impl Eval for CallExpr { type Output = Value; fn eval(&self, ctx: &mut EvalContext) -> TypResult<Self::Output> { + let span = self.callee().span(); let callee = self.callee().eval(ctx)?; let mut args = self.args().eval(ctx)?; @@ -470,13 +471,14 @@ impl Eval for CallExpr { } Value::Class(class) => { - let node = class.construct(ctx, &mut args)?; + let point = || Tracepoint::Call(Some(class.name().to_string())); + let node = class.construct(ctx, &mut args).trace(point, self.span())?; args.finish()?; Ok(Value::Node(node)) } v => bail!( - self.callee().span(), + span, "expected callable or collection, found {}", v.type_name(), ), |
