diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-05 15:45:45 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-05 15:45:45 +0200 |
| commit | fa3e2920c0be01874ba40eebc87ed30f97cdeec7 (patch) | |
| tree | d1d7d4123f10c57efbb30d07d68eb4e675c3f438 /src/eval | |
| parent | 2df8b964d0e6f40451183c207a20d0273907a524 (diff) | |
Remove @ syntax in diagnostics macros 🗑
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/args.rs | 2 | ||||
| -rw-r--r-- | src/eval/mod.rs | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/eval/args.rs b/src/eval/args.rs index b89ee61f..d11deac6 100644 --- a/src/eval/args.rs +++ b/src/eval/args.rs @@ -129,7 +129,7 @@ impl Args { pub fn done(&self, ctx: &mut LayoutContext) { for entry in self.0.v.values() { let span = entry.key_span.join(entry.value.span); - error!(@ctx.f, span, "unexpected argument"); + ctx.diag(error!(span, "unexpected argument")); } } } diff --git a/src/eval/mod.rs b/src/eval/mod.rs index 4ec29056..6f882ab8 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -100,7 +100,7 @@ impl Eval for ExprCall { (func.clone())(args, ctx).await } else { if !name.is_empty() { - error!(@ctx.f, span, "unknown function"); + ctx.diag(error!(span, "unknown function")); ctx.f.decos.push(Deco::Unresolved.span_with(span)); } Value::Dict(dict) @@ -159,7 +159,7 @@ fn neg(ctx: &mut LayoutContext, span: Span, value: Value) -> Value { Relative(v) => Relative(-v), Linear(v) => Linear(-v), v => { - error!(@ctx.f, span, "cannot negate {}", v.ty()); + ctx.diag(error!(span, "cannot negate {}", v.ty())); Value::Error } } @@ -196,7 +196,7 @@ fn add(ctx: &mut LayoutContext, span: Span, lhs: Value, rhs: Value) -> Value { (Commands(a), Commands(b)) => Commands(concat(a, b)), (a, b) => { - error!(@ctx.f, span, "cannot add {} and {}", a.ty(), b.ty()); + ctx.diag(error!(span, "cannot add {} and {}", a.ty(), b.ty())); Value::Error } } @@ -225,7 +225,7 @@ fn sub(ctx: &mut LayoutContext, span: Span, lhs: Value, rhs: Value) -> Value { (Linear(a), Linear(b)) => Linear(a - b), (a, b) => { - error!(@ctx.f, span, "cannot subtract {1} from {0}", a.ty(), b.ty()); + ctx.diag(error!(span, "cannot subtract {1} from {0}", a.ty(), b.ty())); Value::Error } } @@ -260,7 +260,7 @@ fn mul(ctx: &mut LayoutContext, span: Span, lhs: Value, rhs: Value) -> Value { (Str(a), Int(b)) => Str(a.repeat(b.max(0) as usize)), (a, b) => { - error!(@ctx.f, span, "cannot multiply {} with {}", a.ty(), b.ty()); + ctx.diag(error!(span, "cannot multiply {} with {}", a.ty(), b.ty())); Value::Error } } @@ -285,7 +285,7 @@ fn div(ctx: &mut LayoutContext, span: Span, lhs: Value, rhs: Value) -> Value { (Linear(a), Float(b)) => Linear(a / b), (a, b) => { - error!(@ctx.f, span, "cannot divide {} by {}", a.ty(), b.ty()); + ctx.diag(error!(span, "cannot divide {} by {}", a.ty(), b.ty())); Value::Error } } |
