pub mod ast;
pub mod combinators;
pub mod error;
pub mod utils;
pub mod warning;
#[cfg(test)]
mod tests;
use nom_locate::LocatedSpan;
use crate::parser::ast::Ast;
use crate::parser::warning::Warnings;
use crate::Error;
pub type Span<'a> = LocatedSpan<&'a str>;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Position {
pub line: u32,
pub column: usize,
pub offset: usize,
}
pub fn position(span: &Span) -> Position {
Position {
line: span.line,
column: span.get_utf8_column(),
offset: span.offset,
}
}
#[derive(Debug)]
pub struct Parsed {
pub ast: Ast,
pub warnings: Warnings,
}
pub use combinators::parse;