mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-16 09:35:07 +01:00
parse some things
This commit is contained in:
parent
eb68c2b207
commit
5cf64dfc55
4 changed files with 150 additions and 9 deletions
|
|
@ -6,7 +6,21 @@ mod parser;
|
|||
mod pre;
|
||||
mod token;
|
||||
|
||||
pub type Span = std::ops::Range<usize>;
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
|
||||
pub struct Span {
|
||||
pub start: usize,
|
||||
pub end: usize,
|
||||
}
|
||||
|
||||
impl Span {
|
||||
pub fn start_end(start: usize, end: usize) -> Self {
|
||||
Self { start, end }
|
||||
}
|
||||
|
||||
pub fn extend(&self, rhs: Self) -> Self {
|
||||
Self::start_end(self.start, rhs.end)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_file(src: &str) {
|
||||
println!("{src}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue