| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_PARSING_PREPARSER_H | 5 #ifndef V8_PARSING_PREPARSER_H |
| 6 #define V8_PARSING_PREPARSER_H | 6 #define V8_PARSING_PREPARSER_H |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 expression.AddVariable(variable, zone); | 149 expression.AddVariable(variable, zone); |
| 150 return expression; | 150 return expression; |
| 151 } | 151 } |
| 152 | 152 |
| 153 static PreParserExpression BinaryOperation(PreParserExpression left, | 153 static PreParserExpression BinaryOperation(PreParserExpression left, |
| 154 Token::Value op, | 154 Token::Value op, |
| 155 PreParserExpression right) { | 155 PreParserExpression right) { |
| 156 return PreParserExpression(TypeField::encode(kExpression)); | 156 return PreParserExpression(TypeField::encode(kExpression)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 static PreParserExpression Assignment(ZoneList<VariableProxy*>* variables) { | 159 static PreParserExpression Assignment() { |
| 160 return PreParserExpression(TypeField::encode(kExpression) | | 160 return PreParserExpression(TypeField::encode(kExpression) | |
| 161 ExpressionTypeField::encode(kAssignment), | 161 ExpressionTypeField::encode(kAssignment)); |
| 162 variables); | |
| 163 } | 162 } |
| 164 | 163 |
| 165 static PreParserExpression ObjectLiteral( | 164 static PreParserExpression ObjectLiteral( |
| 166 ZoneList<VariableProxy*>* variables) { | 165 ZoneList<VariableProxy*>* variables) { |
| 167 return PreParserExpression(TypeField::encode(kObjectLiteralExpression), | 166 return PreParserExpression(TypeField::encode(kObjectLiteralExpression), |
| 168 variables); | 167 variables); |
| 169 } | 168 } |
| 170 | 169 |
| 171 static PreParserExpression ArrayLiteral(ZoneList<VariableProxy*>* variables) { | 170 static PreParserExpression ArrayLiteral(ZoneList<VariableProxy*>* variables) { |
| 172 return PreParserExpression(TypeField::encode(kArrayLiteralExpression), | 171 return PreParserExpression(TypeField::encode(kArrayLiteralExpression), |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 PreParserExpression right, int pos) { | 610 PreParserExpression right, int pos) { |
| 612 return PreParserExpression::Default(); | 611 return PreParserExpression::Default(); |
| 613 } | 612 } |
| 614 PreParserExpression NewRewritableExpression(PreParserExpression expression) { | 613 PreParserExpression NewRewritableExpression(PreParserExpression expression) { |
| 615 return expression; | 614 return expression; |
| 616 } | 615 } |
| 617 PreParserExpression NewAssignment(Token::Value op, | 616 PreParserExpression NewAssignment(Token::Value op, |
| 618 PreParserExpression left, | 617 PreParserExpression left, |
| 619 PreParserExpression right, | 618 PreParserExpression right, |
| 620 int pos) { | 619 int pos) { |
| 621 // For tracking variables for parameters with a default value. | 620 return PreParserExpression::Assignment(); |
| 622 return PreParserExpression::Assignment(left.variables_); | |
| 623 } | 621 } |
| 624 PreParserExpression NewYield(PreParserExpression generator_object, | 622 PreParserExpression NewYield(PreParserExpression generator_object, |
| 625 PreParserExpression expression, int pos, | 623 PreParserExpression expression, int pos, |
| 626 Yield::OnException on_exception) { | 624 Yield::OnException on_exception) { |
| 627 return PreParserExpression::Default(); | 625 return PreParserExpression::Default(); |
| 628 } | 626 } |
| 629 PreParserExpression NewConditional(PreParserExpression condition, | 627 PreParserExpression NewConditional(PreParserExpression condition, |
| 630 PreParserExpression then_expression, | 628 PreParserExpression then_expression, |
| 631 PreParserExpression else_expression, | 629 PreParserExpression else_expression, |
| 632 int pos) { | 630 int pos) { |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 function_state_->NextMaterializedLiteralIndex(); | 1596 function_state_->NextMaterializedLiteralIndex(); |
| 1599 function_state_->NextMaterializedLiteralIndex(); | 1597 function_state_->NextMaterializedLiteralIndex(); |
| 1600 } | 1598 } |
| 1601 return EmptyExpression(); | 1599 return EmptyExpression(); |
| 1602 } | 1600 } |
| 1603 | 1601 |
| 1604 } // namespace internal | 1602 } // namespace internal |
| 1605 } // namespace v8 | 1603 } // namespace v8 |
| 1606 | 1604 |
| 1607 #endif // V8_PARSING_PREPARSER_H | 1605 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |