mirror of
https://github.com/swc-project/swc.git
synced 2025-01-03 11:01:52 +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();
|
||||
let c = self.input.cur();
|
||||
if c == Some('!') {
|
||||
loop {
|
||||
while let Some(c) = self.input.cur() {
|
||||
if c != '\n' && c != '\r' && c != '\u{8232}' && c != '\u{8233}' {
|
||||
self.input.bump();
|
||||
continue;
|
||||
}
|
||||
while let Some(c) = self.input.cur() {
|
||||
self.input.bump();
|
||||
if c == '\n' || c == '\r' || c == '\u{8232}' || c == '\u{8233}' {
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
Ok(false)
|
||||
} else {
|
||||
self.input.reset_to(start);
|
||||
Ok(false)
|
||||
|
Loading…
Reference in New Issue
Block a user