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

Unified Diff: src/preparser.cc

Issue 169853002: (Pre)Parser: Move ParseExpression and ParseArrayLiteral to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: old chunk schmold chunk Created 6 years, 10 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') | no next file » | 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 fc4481fd868d24b1a13a627db6d961fbdeae5dea..934a2e5d3355ad80cedce1d6ac57ebc3c81d5a0d 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -122,18 +122,14 @@ PreParserExpression PreParserTraits::ExpressionFromString(
}
-PreParserExpression PreParserTraits::ParseArrayLiteral(bool* ok) {
- return pre_parser_->ParseArrayLiteral(ok);
-}
-
-
PreParserExpression PreParserTraits::ParseObjectLiteral(bool* ok) {
return pre_parser_->ParseObjectLiteral(ok);
}
-PreParserExpression PreParserTraits::ParseExpression(bool accept_IN, bool* ok) {
- return pre_parser_->ParseExpression(accept_IN, ok);
+PreParserExpression PreParserTraits::ParseAssignmentExpression(bool accept_IN,
+ bool* ok) {
+ return pre_parser_->ParseAssignmentExpression(accept_IN, ok);
}
@@ -834,22 +830,6 @@ PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) {
#undef DUMMY
-// Precedence = 1
-PreParser::Expression PreParser::ParseExpression(bool accept_IN, bool* ok) {
- // Expression ::
- // AssignmentExpression
- // Expression ',' AssignmentExpression
-
- Expression result = ParseAssignmentExpression(accept_IN, CHECK_OK);
- while (peek() == Token::COMMA) {
- Expect(Token::COMMA, CHECK_OK);
- ParseAssignmentExpression(accept_IN, CHECK_OK);
- result = Expression::Default();
- }
- return result;
-}
-
-
// Precedence = 2
PreParser::Expression PreParser::ParseAssignmentExpression(bool accept_IN,
bool* ok) {
@@ -1142,25 +1122,6 @@ PreParser::Expression PreParser::ParseMemberExpressionContinuation(
}
-PreParser::Expression PreParser::ParseArrayLiteral(bool* ok) {
- // ArrayLiteral ::
- // '[' Expression? (',' Expression?)* ']'
- Expect(Token::LBRACK, CHECK_OK);
- while (peek() != Token::RBRACK) {
- if (peek() != Token::COMMA) {
- ParseAssignmentExpression(true, CHECK_OK);
- }
- if (peek() != Token::RBRACK) {
- Expect(Token::COMMA, CHECK_OK);
- }
- }
- Expect(Token::RBRACK, CHECK_OK);
-
- function_state_->NextMaterializedLiteralIndex();
- return Expression::Default();
-}
-
-
PreParser::Expression PreParser::ParseObjectLiteral(bool* ok) {
// ObjectLiteral ::
// '{' (
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698