remove eprintlns from lexer
This commit is contained in:
parent
a2632ca06e
commit
0468f1fab3
|
|
@ -380,21 +380,14 @@ pub(crate) fn parse_comment<'a>(source: &'a mut Source) -> Result<bool> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let doc = source.next_if_eq(&'/').is_some();
|
let doc = source.next_if_eq(&'/').is_some();
|
||||||
eprintln!("doc comment: {doc}");
|
|
||||||
loop {
|
loop {
|
||||||
// take until new line
|
// take until new line
|
||||||
source
|
source.take_while_inclusive(|&c| c != '\n').for_each(drop);
|
||||||
.take_while_inclusive(|&c| c != '\n')
|
|
||||||
.inspect(|c| eprintln!("skipping comment char: {c}"))
|
|
||||||
.for_each(drop);
|
|
||||||
|
|
||||||
let mut copy = source.clone();
|
let mut copy = source.clone();
|
||||||
// skip whitespaces after new line to find continuation of comment
|
// skip whitespaces after new line to find continuation of comment
|
||||||
(&mut copy)
|
(&mut copy)
|
||||||
.take_while_ref(|&c| {
|
.take_while_ref(|&c| is_things::is_whitespace(c) && c != '\n')
|
||||||
eprintln!("Skipping whitespace: {c}");
|
|
||||||
is_things::is_whitespace(c) && c != '\n'
|
|
||||||
})
|
|
||||||
.for_each(drop);
|
.for_each(drop);
|
||||||
|
|
||||||
if (copy.next() == Some('/')) && (copy.next() == Some('/')) {
|
if (copy.next() == Some('/')) && (copy.next() == Some('/')) {
|
||||||
|
|
|
||||||
|
|
@ -496,8 +496,6 @@ impl<'a> TokenIterator<'a> {
|
||||||
Some('/') if self.follows("//") => {
|
Some('/') if self.follows("//") => {
|
||||||
let doc = complex_tokens::parse_comment(&mut source).ok()?;
|
let doc = complex_tokens::parse_comment(&mut source).ok()?;
|
||||||
self.offset += source.offset();
|
self.offset += source.offset();
|
||||||
eprintln!("next: {:?}", source.next());
|
|
||||||
eprintln!("rest: {:?}", &self.source[self.offset..]);
|
|
||||||
|
|
||||||
let lexeme = &self.source[start..self.offset];
|
let lexeme = &self.source[start..self.offset];
|
||||||
if doc {
|
if doc {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue