parse some things

This commit is contained in:
nora 2022-06-21 21:51:26 +02:00
parent eb68c2b207
commit 5cf64dfc55
4 changed files with 150 additions and 9 deletions

View file

@ -3,7 +3,7 @@
//!
//! Code might be bad. Possibly.
use std::{ops::Not, fmt::Display};
use std::{fmt::Display, ops::Not};
use peekmore::PeekMore;
@ -398,11 +398,11 @@ where
}
};
Some((token, start_span..end_span + 1))
Some((token, Span::start_end(start_span, end_span + 1)))
}
}
pub fn preprocess_tokens(src: &str) -> impl Iterator<Item = (PToken<'_>, std::ops::Range<usize>)> {
pub fn preprocess_tokens(src: &str) -> impl Iterator<Item = (PToken<'_>, Span)> {
let lexer = PLexer {
src_str: src,
src: src.bytes().enumerate().peekmore(),