mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2025-09-25 16:01:30 +02:00
implement basic namespacing for types, traits and commands
This commit is contained in:
parent
3cca2bc2cc
commit
b6b8c5085a
5 changed files with 287 additions and 6 deletions
|
@ -13,11 +13,11 @@ pub enum SyntaxError {
|
|||
MissingSink(Vec<(FileId, logos::Span)>),
|
||||
/// This indicates a missing filter somewhere in the pipeline, meaning that there's 2 pipes after one another
|
||||
MissingFilter(Vec<(FileId, logos::Span)>),
|
||||
/// A literal cannot be a sink
|
||||
/// A literal cannot be a sink, TODO
|
||||
LiteralAsSink,
|
||||
/// A literal can't be a filter either
|
||||
/// A literal can't be a filter either, TODO
|
||||
LiteralAsFilter,
|
||||
/// A literal acting as streamer cannot take arguments
|
||||
/// A literal acting as streamer cannot take arguments, TODO
|
||||
LiteralWithArgs,
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,16 @@ impl SyntaxError {
|
|||
})
|
||||
.collect(),
|
||||
),
|
||||
_ => todo!(),
|
||||
Self::MissingSink(locs) => Diagnostic::error()
|
||||
.with_message("pipelines cannot end on a pipe")
|
||||
.with_labels(
|
||||
locs.into_iter()
|
||||
.map(|(file_id, span)| {
|
||||
Label::primary(*file_id, span.clone()).with_message("no sink")
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue