added basic method to check syntax command input

This commit is contained in:
Schrottkatze 2023-11-18 19:46:41 +01:00
parent 03412ce8cd
commit 3952091018
6 changed files with 251 additions and 7 deletions

View file

@ -4,10 +4,8 @@ use super::{
};
pub fn check(
syntax: Vec<PipelineElement>,
raw_source: &str,
file_id: FileId,
) -> Result<Vec<PipelineElement>, Vec<SyntaxError>> {
syntax: &Vec<PipelineElement>,
) -> Result<(), Vec<SyntaxError>> {
let mut errs = Vec::new();
if let Err(e_span) = check_missing_streamer(&syntax) {
@ -23,7 +21,7 @@ pub fn check(
}
if errs.is_empty() {
Ok(syntax)
Ok(())
} else {
Err(errs)
}

View file

@ -6,7 +6,7 @@ use logos::Span;
use crate::lexer::Token;
pub mod check;
mod error;
pub mod error;
#[derive(Debug, Clone, PartialEq)]
pub struct PipelineElement {