move parser to diagnostics
this moves all errors in the parser to diagnostics. see #190
pipeline context
a94c4580 is interesting: the following code panics on master
fn top() -> bool {
let x = true;
stage(+1).x
}
thread 'main' panicked at spade-ast-lowering/src/lib.rs:1511:18:
Expected to have a pipeline context
this is now reported with a diagnostic
error: pipeline stage reference in function
┌─ main.spade:3:5
│
1 │ fn top() -> bool {
│ -- this is a function
2 │ let x = true;
3 │ stage(+1).x
│ ^^^^^ pipeline stage reference not allowed here
│
= note: only pipelines can contain pipeline stage references
Error: aborting due to previous error
Author checklist
-
New Diagnostics have at least one snapshot test that triggers it - [n/a] Added a line to CHANGELOG.md, if relevant
Edited by Gustav Sörnäs