mod error;
pub mod lexer;
pub mod parser;
pub mod preprocessor;
pub mod report;
use ariadne::{Color, Label};
pub use error::*;
use lexer::*;
pub use lexer::{LexedSource, Token, lex};
pub use parser::parse;
use parser::*;
pub(crate) use preprocessor::*;
pub use preprocessor::{
PreprocessorCache, PreprocessorError, PreprocessorState, preprocess,
};
use winnow::Parser;
use winnow::stream::TokenSlice;
#[cfg(test)]
pub mod test;
pub use scarf_syntax::Span;
#[cfg(test)]
pub use test::*;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SpannedString<'a>(pub &'a str, pub Span<'a>);
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SpannedToken<'s>(pub Token<'s>, pub Span<'s>);
impl<'s> PartialEq<Token<'s>> for SpannedToken<'s> {
fn eq(&self, other: &Token) -> bool {
self.0 == *other
}
}
impl<'s> From<(Token<'s>, Span<'s>)> for SpannedToken<'s> {
fn from(item: (Token<'s>, Span<'s>)) -> Self {
(item.0, item.1).into()
}
}