mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2025-10-30 00:57:58 +01: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
|
|
@ -20,6 +20,10 @@ pub fn check(
|
|||
))
|
||||
}
|
||||
|
||||
if let Err(e_span) = check_missing_sink(&syntax) {
|
||||
errs.push(SyntaxError::MissingSink(vec![(file_id, e_span)]));
|
||||
}
|
||||
|
||||
if errs.is_empty() {
|
||||
Ok(syntax)
|
||||
} else {
|
||||
|
|
@ -44,11 +48,11 @@ fn check_missing_filters(syntax: &Vec<PipelineElement>) -> Result<(), Vec<logos:
|
|||
|
||||
for i in 0..syntax.len() {
|
||||
if let (
|
||||
Some(PipelineElement {
|
||||
Some(&PipelineElement {
|
||||
kind: PipelineElementKind::Pipe,
|
||||
ref span,
|
||||
}),
|
||||
Some(PipelineElement {
|
||||
Some(&PipelineElement {
|
||||
kind: PipelineElementKind::Pipe,
|
||||
span: ref span1,
|
||||
}),
|
||||
|
|
@ -64,3 +68,15 @@ fn check_missing_filters(syntax: &Vec<PipelineElement>) -> Result<(), Vec<logos:
|
|||
Err(missing_filter_locs)
|
||||
}
|
||||
}
|
||||
|
||||
fn check_missing_sink(syntax: &Vec<PipelineElement>) -> Result<(), logos::Span> {
|
||||
if let Some(&PipelineElement {
|
||||
kind: PipelineElementKind::Pipe,
|
||||
ref span,
|
||||
}) = syntax.last()
|
||||
{
|
||||
Err(span.clone())
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue