|
|
@ -17,7 +17,7 @@ use crate::syntax::{ |
|
|
|
}, |
|
|
|
}, |
|
|
|
Keyword, Punctuator, |
|
|
|
Keyword, Punctuator, |
|
|
|
}, |
|
|
|
}, |
|
|
|
lexer::TokenKind, |
|
|
|
lexer::{InputElement, TokenKind}, |
|
|
|
parser::{ |
|
|
|
parser::{ |
|
|
|
expression::{ |
|
|
|
expression::{ |
|
|
|
left_hand_side::template::TaggedTemplateLiteral, primary::PrimaryExpression, Expression, |
|
|
|
left_hand_side::template::TaggedTemplateLiteral, primary::PrimaryExpression, Expression, |
|
|
@ -67,6 +67,8 @@ where |
|
|
|
fn parse(self, cursor: &mut Cursor<R>, interner: &mut Interner) -> ParseResult<Self::Output> { |
|
|
|
fn parse(self, cursor: &mut Cursor<R>, interner: &mut Interner) -> ParseResult<Self::Output> { |
|
|
|
let _timer = Profiler::global().start_event("MemberExpression", "Parsing"); |
|
|
|
let _timer = Profiler::global().start_event("MemberExpression", "Parsing"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cursor.set_goal(InputElement::RegExp); |
|
|
|
|
|
|
|
|
|
|
|
let token = cursor.peek(0, interner)?.ok_or(ParseError::AbruptEnd)?; |
|
|
|
let token = cursor.peek(0, interner)?.ok_or(ParseError::AbruptEnd)?; |
|
|
|
let mut lhs = match token.kind() { |
|
|
|
let mut lhs = match token.kind() { |
|
|
|
TokenKind::Keyword((Keyword::New | Keyword::Super, true)) => { |
|
|
|
TokenKind::Keyword((Keyword::New | Keyword::Super, true)) => { |
|
|
@ -160,6 +162,8 @@ where |
|
|
|
.parse(cursor, interner)?, |
|
|
|
.parse(cursor, interner)?, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cursor.set_goal(InputElement::TemplateTail); |
|
|
|
|
|
|
|
|
|
|
|
while let Some(tok) = cursor.peek(0, interner)? { |
|
|
|
while let Some(tok) = cursor.peek(0, interner)? { |
|
|
|
match tok.kind() { |
|
|
|
match tok.kind() { |
|
|
|
TokenKind::Punctuator(Punctuator::Dot) => { |
|
|
|
TokenKind::Punctuator(Punctuator::Dot) => { |
|
|
|