1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// TODO: Make different presets for languages with a preset-<language> feature.
// TODO: Add no_std feature.

pub mod compiler;
pub mod cursor;
pub mod macros;
pub mod parse;
pub mod snapshot;
pub mod spec;

#[cfg(feature = "span")]
#[derive(Debug, Default, PartialEq, Eq, Hash, Copy, Clone)]
pub struct Span {
    pub begin: usize,
    pub end: usize,
}

#[cfg(feature = "span")]
pub trait Spanned {
    fn span(&self) -> Span;
    fn span_ref_mut(&mut self) -> &mut Span;
}

pub type Result<T> = std::result::Result<T, &'static str>;

// TODO: Create helper methods like these vvvvvvvvvvvvvvvvvvvvvvvvvvv
/*pub fn parse_stream(input: &str) -> ParseStream {
    ParseStream::new(input.chars().collect::<Vec<char>>().as_slice())
}*/