Chromium Code Reviews| 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/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/parsing/parser-base.h" | 9 #include "src/parsing/parser-base.h" |
| 10 | 10 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 | 444 |
| 445 bool IsEmptyStatement() { return code_ == kEmptyStatement; } | 445 bool IsEmptyStatement() { return code_ == kEmptyStatement; } |
| 446 | 446 |
| 447 // Dummy implementation for making statement->somefunc() work in both Parser | 447 // Dummy implementation for making statement->somefunc() work in both Parser |
| 448 // and PreParser. | 448 // and PreParser. |
| 449 PreParserStatement* operator->() { return this; } | 449 PreParserStatement* operator->() { return this; } |
| 450 | 450 |
| 451 PreParserStatementList statements() { return PreParserStatementList(); } | 451 PreParserStatementList statements() { return PreParserStatementList(); } |
| 452 void set_scope(Scope* scope) {} | 452 void set_scope(Scope* scope) {} |
| 453 void Initialize(PreParserExpression cond, PreParserStatement body) {} | 453 void Initialize(PreParserExpression cond, PreParserStatement body) {} |
| 454 void Initialize(PreParserStatement init, PreParserExpression cond, | |
| 455 PreParserStatement next, PreParserStatement body) {} | |
| 454 | 456 |
|
marja
2016/09/21 08:23:21
In addition, shouldn't you remove PreParser::Parse
nickie
2016/09/21 09:20:02
Yes, obviously. Done.
| |
| 455 private: | 457 private: |
| 456 enum Type { | 458 enum Type { |
| 457 kNullStatement, | 459 kNullStatement, |
| 458 kEmptyStatement, | 460 kEmptyStatement, |
| 459 kUnknownStatement, | 461 kUnknownStatement, |
| 460 kJumpStatement, | 462 kJumpStatement, |
| 461 kStringLiteralExpressionStatement, | 463 kStringLiteralExpressionStatement, |
| 462 kUseStrictExpressionStatement, | 464 kUseStrictExpressionStatement, |
| 463 kUseAsmExpressionStatement, | 465 kUseAsmExpressionStatement, |
| 464 }; | 466 }; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 PreParserStatement NewSwitchStatement(ZoneList<const AstRawString*>* labels, | 661 PreParserStatement NewSwitchStatement(ZoneList<const AstRawString*>* labels, |
| 660 int pos) { | 662 int pos) { |
| 661 return PreParserStatement::Default(); | 663 return PreParserStatement::Default(); |
| 662 } | 664 } |
| 663 | 665 |
| 664 PreParserStatement NewCaseClause(PreParserExpression label, | 666 PreParserStatement NewCaseClause(PreParserExpression label, |
| 665 PreParserStatementList statements, int pos) { | 667 PreParserStatementList statements, int pos) { |
| 666 return PreParserStatement::Default(); | 668 return PreParserStatement::Default(); |
| 667 } | 669 } |
| 668 | 670 |
| 671 PreParserStatement NewForStatement(ZoneList<const AstRawString*>* labels, | |
| 672 int pos) { | |
| 673 return PreParserStatement::Default(); | |
| 674 } | |
| 675 | |
| 676 PreParserStatement NewForEachStatement(ForEachStatement::VisitMode visit_mode, | |
| 677 ZoneList<const AstRawString*>* labels, | |
| 678 int pos) { | |
| 679 return PreParserStatement::Default(); | |
| 680 } | |
| 681 | |
| 669 // Return the object itself as AstVisitor and implement the needed | 682 // Return the object itself as AstVisitor and implement the needed |
| 670 // dummy method right in this class. | 683 // dummy method right in this class. |
| 671 PreParserFactory* visitor() { return this; } | 684 PreParserFactory* visitor() { return this; } |
| 672 int* ast_properties() { | 685 int* ast_properties() { |
| 673 static int dummy = 42; | 686 static int dummy = 42; |
| 674 return &dummy; | 687 return &dummy; |
| 675 } | 688 } |
| 676 }; | 689 }; |
| 677 | 690 |
| 678 | 691 |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 V8_INLINE PreParserExpression BuildUnaryExpression( | 1127 V8_INLINE PreParserExpression BuildUnaryExpression( |
| 1115 PreParserExpression expression, Token::Value op, int pos) { | 1128 PreParserExpression expression, Token::Value op, int pos) { |
| 1116 return PreParserExpression::Default(); | 1129 return PreParserExpression::Default(); |
| 1117 } | 1130 } |
| 1118 | 1131 |
| 1119 V8_INLINE PreParserExpression BuildIteratorResult(PreParserExpression value, | 1132 V8_INLINE PreParserExpression BuildIteratorResult(PreParserExpression value, |
| 1120 bool done) { | 1133 bool done) { |
| 1121 return PreParserExpression::Default(); | 1134 return PreParserExpression::Default(); |
| 1122 } | 1135 } |
| 1123 | 1136 |
| 1137 V8_INLINE PreParserStatement | |
| 1138 BuildInitializationBlock(DeclarationParsingResult* parsing_result, | |
| 1139 ZoneList<const AstRawString*>* names, bool* ok) { | |
| 1140 return PreParserStatement::Default(); | |
| 1141 } | |
| 1142 | |
| 1143 V8_INLINE PreParserStatement | |
| 1144 InitializeForEachStatement(PreParserStatement stmt, PreParserExpression each, | |
| 1145 PreParserExpression subject, | |
| 1146 PreParserStatement body, int each_keyword_pos) { | |
| 1147 return stmt; | |
| 1148 } | |
| 1149 | |
| 1150 V8_INLINE PreParserStatement RewriteForVarInLegacy(ForInfo* for_info) { | |
| 1151 return PreParserStatement::Null(); | |
| 1152 } | |
| 1153 V8_INLINE std::pair<PreParserStatement, PreParserExpression> | |
| 1154 DesugarBindingInForEachStatement(ForInfo* for_info, bool* ok) { | |
| 1155 return std::make_pair(PreParserStatement::Default(), | |
| 1156 PreParserExpression::Default()); | |
| 1157 } | |
| 1158 V8_INLINE PreParserStatement CreateForEachStatementTDZ( | |
| 1159 PreParserStatement init_block, ForInfo* for_info, bool* ok) { | |
| 1160 return init_block; | |
| 1161 } | |
| 1162 | |
| 1163 V8_INLINE StatementT DesugarLexicalBindingsInForStatement( | |
| 1164 PreParserStatement loop, PreParserStatement init, | |
| 1165 PreParserExpression cond, PreParserStatement next, | |
| 1166 PreParserStatement body, Scope* inner_scope, ForInfo* for_info, | |
| 1167 bool* ok) { | |
| 1168 return loop; | |
| 1169 } | |
| 1170 | |
| 1124 V8_INLINE PreParserExpression | 1171 V8_INLINE PreParserExpression |
| 1125 NewThrowReferenceError(MessageTemplate::Template message, int pos) { | 1172 NewThrowReferenceError(MessageTemplate::Template message, int pos) { |
| 1126 return PreParserExpression::Default(); | 1173 return PreParserExpression::Default(); |
| 1127 } | 1174 } |
| 1128 | 1175 |
| 1129 V8_INLINE PreParserExpression NewThrowSyntaxError( | 1176 V8_INLINE PreParserExpression NewThrowSyntaxError( |
| 1130 MessageTemplate::Template message, PreParserIdentifier arg, int pos) { | 1177 MessageTemplate::Template message, PreParserIdentifier arg, int pos) { |
| 1131 return PreParserExpression::Default(); | 1178 return PreParserExpression::Default(); |
| 1132 } | 1179 } |
| 1133 | 1180 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1416 function_state_->NextMaterializedLiteralIndex(); | 1463 function_state_->NextMaterializedLiteralIndex(); |
| 1417 function_state_->NextMaterializedLiteralIndex(); | 1464 function_state_->NextMaterializedLiteralIndex(); |
| 1418 } | 1465 } |
| 1419 return EmptyExpression(); | 1466 return EmptyExpression(); |
| 1420 } | 1467 } |
| 1421 | 1468 |
| 1422 } // namespace internal | 1469 } // namespace internal |
| 1423 } // namespace v8 | 1470 } // namespace v8 |
| 1424 | 1471 |
| 1425 #endif // V8_PARSING_PREPARSER_H | 1472 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |