remove eprintlns from lexer

This commit is contained in:
janis 2025-10-14 13:22:54 +02:00
parent a2632ca06e
commit 0468f1fab3
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8
2 changed files with 2 additions and 11 deletions

View file

@ -380,21 +380,14 @@ pub(crate) fn parse_comment<'a>(source: &'a mut Source) -> Result<bool> {
}
let doc = source.next_if_eq(&'/').is_some();
eprintln!("doc comment: {doc}");
loop {
// take until new line
source
.take_while_inclusive(|&c| c != '\n')
.inspect(|c| eprintln!("skipping comment char: {c}"))
.for_each(drop);
source.take_while_inclusive(|&c| c != '\n').for_each(drop);
let mut copy = source.clone();
// skip whitespaces after new line to find continuation of comment
(&mut copy)
.take_while_ref(|&c| {
eprintln!("Skipping whitespace: {c}");
is_things::is_whitespace(c) && c != '\n'
})
.take_while_ref(|&c| is_things::is_whitespace(c) && c != '\n')
.for_each(drop);
if (copy.next() == Some('/')) && (copy.next() == Some('/')) {

View file

@ -496,8 +496,6 @@ impl<'a> TokenIterator<'a> {
Some('/') if self.follows("//") => {
let doc = complex_tokens::parse_comment(&mut source).ok()?;
self.offset += source.offset();
eprintln!("next: {:?}", source.next());
eprintln!("rest: {:?}", &self.source[self.offset..]);
let lexeme = &self.source[start..self.offset];
if doc {