mirror of
https://github.com/swc-project/swc.git
synced 2025-01-07 06:06:41 +03:00
fix(es/lexer): Fix parsing of interpreter (#2589)
This commit is contained in:
parent
b197eb65af
commit
52318a4a8e
@ -461,14 +461,13 @@ impl<'a, I: Input> Lexer<'a, I> {
|
|||||||
self.input.bump();
|
self.input.bump();
|
||||||
let c = self.input.cur();
|
let c = self.input.cur();
|
||||||
if c == Some('!') {
|
if c == Some('!') {
|
||||||
loop {
|
|
||||||
while let Some(c) = self.input.cur() {
|
while let Some(c) = self.input.cur() {
|
||||||
if c != '\n' && c != '\r' && c != '\u{8232}' && c != '\u{8233}' {
|
|
||||||
self.input.bump();
|
self.input.bump();
|
||||||
continue;
|
if c == '\n' || c == '\r' || c == '\u{8232}' || c == '\u{8233}' {
|
||||||
}
|
return Ok(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Ok(false)
|
||||||
} else {
|
} else {
|
||||||
self.input.reset_to(start);
|
self.input.reset_to(start);
|
||||||
Ok(false)
|
Ok(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user