|
|
@ -11,7 +11,10 @@ use crate::{ |
|
|
|
syntax::{ |
|
|
|
syntax::{ |
|
|
|
ast::{node, op::UnaryOp, Node, Punctuator}, |
|
|
|
ast::{node, op::UnaryOp, Node, Punctuator}, |
|
|
|
lexer::TokenKind, |
|
|
|
lexer::TokenKind, |
|
|
|
parser::{AllowAwait, AllowYield, Cursor, ParseError, ParseResult, TokenParser}, |
|
|
|
parser::{ |
|
|
|
|
|
|
|
expression::unary::UnaryExpression, AllowAwait, AllowYield, Cursor, ParseError, |
|
|
|
|
|
|
|
ParseResult, TokenParser, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -58,8 +61,7 @@ where |
|
|
|
cursor.next()?.expect("Punctuator::Inc token disappeared"); |
|
|
|
cursor.next()?.expect("Punctuator::Inc token disappeared"); |
|
|
|
return Ok(node::UnaryOp::new( |
|
|
|
return Ok(node::UnaryOp::new( |
|
|
|
UnaryOp::IncrementPre, |
|
|
|
UnaryOp::IncrementPre, |
|
|
|
LeftHandSideExpression::new(self.allow_yield, self.allow_await) |
|
|
|
UnaryExpression::new(self.allow_yield, self.allow_await).parse(cursor)?, |
|
|
|
.parse(cursor)?, |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
.into()); |
|
|
|
.into()); |
|
|
|
} |
|
|
|
} |
|
|
@ -67,8 +69,7 @@ where |
|
|
|
cursor.next()?.expect("Punctuator::Dec token disappeared"); |
|
|
|
cursor.next()?.expect("Punctuator::Dec token disappeared"); |
|
|
|
return Ok(node::UnaryOp::new( |
|
|
|
return Ok(node::UnaryOp::new( |
|
|
|
UnaryOp::DecrementPre, |
|
|
|
UnaryOp::DecrementPre, |
|
|
|
LeftHandSideExpression::new(self.allow_yield, self.allow_await) |
|
|
|
UnaryExpression::new(self.allow_yield, self.allow_await).parse(cursor)?, |
|
|
|
.parse(cursor)?, |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
.into()); |
|
|
|
.into()); |
|
|
|
} |
|
|
|
} |
|
|
|