Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: src/preparser.cc

Issue 203193004: Move ParseUnaryExpression into ParserBase and add tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang build fixes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 8a621b4ff2455b1888e7bbd06ac2bc15258a9063..398f32744cb61ff6c5e5af317d22b8d117f37b9f 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -146,8 +146,8 @@ PreParserExpression PreParserTraits::ParseFunctionLiteral(
}
-PreParserExpression PreParserTraits::ParseUnaryExpression(bool* ok) {
- return pre_parser_->ParseUnaryExpression(ok);
+PreParserExpression PreParserTraits::ParsePostfixExpression(bool* ok) {
+ return pre_parser_->ParsePostfixExpression(ok);
}
@@ -842,37 +842,6 @@ PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) {
#undef DUMMY
-PreParser::Expression PreParser::ParseUnaryExpression(bool* ok) {
- // UnaryExpression ::
- // PostfixExpression
- // 'delete' UnaryExpression
- // 'void' UnaryExpression
- // 'typeof' UnaryExpression
- // '++' UnaryExpression
- // '--' UnaryExpression
- // '+' UnaryExpression
- // '-' UnaryExpression
- // '~' UnaryExpression
- // '!' UnaryExpression
-
- Token::Value op = peek();
- if (Token::IsUnaryOp(op)) {
- op = Next();
- ParseUnaryExpression(ok);
- return Expression::Default();
- } else if (Token::IsCountOp(op)) {
- op = Next();
- Expression expression = ParseUnaryExpression(CHECK_OK);
- if (strict_mode() == STRICT) {
- CheckStrictModeLValue(expression, CHECK_OK);
- }
- return Expression::Default();
- } else {
- return ParsePostfixExpression(ok);
- }
-}
-
-
PreParser::Expression PreParser::ParsePostfixExpression(bool* ok) {
// PostfixExpression ::
// LeftHandSideExpression ('++' | '--')?
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698