| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 PreParserStatement NewDoWhileStatement(ZoneList<const AstRawString*>* labels, | 657 PreParserStatement NewDoWhileStatement(ZoneList<const AstRawString*>* labels, |
| 658 int pos) { | 658 int pos) { |
| 659 return PreParserStatement::Default(); | 659 return PreParserStatement::Default(); |
| 660 } | 660 } |
| 661 | 661 |
| 662 PreParserStatement NewWhileStatement(ZoneList<const AstRawString*>* labels, | 662 PreParserStatement NewWhileStatement(ZoneList<const AstRawString*>* labels, |
| 663 int pos) { | 663 int pos) { |
| 664 return PreParserStatement::Default(); | 664 return PreParserStatement::Default(); |
| 665 } | 665 } |
| 666 | 666 |
| 667 PreParserStatement NewSwitchStatement(ZoneList<const AstRawString*>* labels, |
| 668 int pos) { |
| 669 return PreParserStatement::Default(); |
| 670 } |
| 671 |
| 672 PreParserStatement NewCaseClause(PreParserExpression label, |
| 673 PreParserStatementList statements, int pos) { |
| 674 return PreParserStatement::Default(); |
| 675 } |
| 676 |
| 667 // Return the object itself as AstVisitor and implement the needed | 677 // Return the object itself as AstVisitor and implement the needed |
| 668 // dummy method right in this class. | 678 // dummy method right in this class. |
| 669 PreParserFactory* visitor() { return this; } | 679 PreParserFactory* visitor() { return this; } |
| 670 int* ast_properties() { | 680 int* ast_properties() { |
| 671 static int dummy = 42; | 681 static int dummy = 42; |
| 672 return &dummy; | 682 return &dummy; |
| 673 } | 683 } |
| 674 }; | 684 }; |
| 675 | 685 |
| 676 | 686 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 typedef PreParserExpression Expression; | 720 typedef PreParserExpression Expression; |
| 711 typedef PreParserExpression FunctionLiteral; | 721 typedef PreParserExpression FunctionLiteral; |
| 712 typedef PreParserExpression ObjectLiteralProperty; | 722 typedef PreParserExpression ObjectLiteralProperty; |
| 713 typedef PreParserExpression ClassLiteralProperty; | 723 typedef PreParserExpression ClassLiteralProperty; |
| 714 typedef PreParserExpressionList ExpressionList; | 724 typedef PreParserExpressionList ExpressionList; |
| 715 typedef PreParserExpressionList PropertyList; | 725 typedef PreParserExpressionList PropertyList; |
| 716 typedef PreParserFormalParameters FormalParameters; | 726 typedef PreParserFormalParameters FormalParameters; |
| 717 typedef PreParserStatement Statement; | 727 typedef PreParserStatement Statement; |
| 718 typedef PreParserStatementList StatementList; | 728 typedef PreParserStatementList StatementList; |
| 719 typedef PreParserStatement Block; | 729 typedef PreParserStatement Block; |
| 720 typedef PreParserStatement BreakableStatementT; | 730 typedef PreParserStatement BreakableStatement; |
| 721 typedef PreParserStatement IterationStatementT; | 731 typedef PreParserStatement IterationStatement; |
| 722 | 732 |
| 723 // For constructing objects returned by the traversing functions. | 733 // For constructing objects returned by the traversing functions. |
| 724 typedef PreParserFactory Factory; | 734 typedef PreParserFactory Factory; |
| 725 | 735 |
| 726 typedef PreParserTarget Target; | 736 typedef PreParserTarget Target; |
| 727 typedef PreParserTargetScope TargetScope; | 737 typedef PreParserTargetScope TargetScope; |
| 728 }; | 738 }; |
| 729 | 739 |
| 730 | 740 |
| 731 // Preparsing checks a JavaScript program and emits preparse-data that helps | 741 // Preparsing checks a JavaScript program and emits preparse-data that helps |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 bool default_export, bool* ok); | 835 bool default_export, bool* ok); |
| 826 Statement ParseHoistableDeclaration(int pos, ParseFunctionFlags flags, | 836 Statement ParseHoistableDeclaration(int pos, ParseFunctionFlags flags, |
| 827 ZoneList<const AstRawString*>* names, | 837 ZoneList<const AstRawString*>* names, |
| 828 bool default_export, bool* ok); | 838 bool default_export, bool* ok); |
| 829 Statement ParseFunctionDeclaration(bool* ok); | 839 Statement ParseFunctionDeclaration(bool* ok); |
| 830 Statement ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names, | 840 Statement ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names, |
| 831 bool default_export, bool* ok); | 841 bool default_export, bool* ok); |
| 832 Expression ParseAsyncFunctionExpression(bool* ok); | 842 Expression ParseAsyncFunctionExpression(bool* ok); |
| 833 Statement ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 843 Statement ParseClassDeclaration(ZoneList<const AstRawString*>* names, |
| 834 bool default_export, bool* ok); | 844 bool default_export, bool* ok); |
| 835 Statement ParseSwitchStatement(ZoneList<const AstRawString*>* labels, | |
| 836 bool* ok); | |
| 837 Statement ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); | 845 Statement ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); |
| 838 Statement ParseTryStatement(bool* ok); | 846 Statement ParseTryStatement(bool* ok); |
| 839 Expression ParseConditionalExpression(bool accept_IN, bool* ok); | 847 Expression ParseConditionalExpression(bool accept_IN, bool* ok); |
| 840 Expression ParseObjectLiteral(bool* ok); | 848 Expression ParseObjectLiteral(bool* ok); |
| 841 | 849 |
| 842 V8_INLINE PreParserStatementList ParseEagerFunctionBody( | 850 V8_INLINE PreParserStatementList ParseEagerFunctionBody( |
| 843 PreParserIdentifier function_name, int pos, | 851 PreParserIdentifier function_name, int pos, |
| 844 const PreParserFormalParameters& parameters, FunctionKind kind, | 852 const PreParserFormalParameters& parameters, FunctionKind kind, |
| 845 FunctionLiteral::FunctionType function_type, bool* ok); | 853 FunctionLiteral::FunctionType function_type, bool* ok); |
| 846 | 854 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 // TODO(nikolaos): The preparser currently does not keep track of labels. | 952 // TODO(nikolaos): The preparser currently does not keep track of labels. |
| 945 V8_INLINE bool ContainsLabel(ZoneList<const AstRawString*>* labels, | 953 V8_INLINE bool ContainsLabel(ZoneList<const AstRawString*>* labels, |
| 946 PreParserIdentifier label) { | 954 PreParserIdentifier label) { |
| 947 return false; | 955 return false; |
| 948 } | 956 } |
| 949 | 957 |
| 950 V8_INLINE PreParserExpression RewriteReturn(PreParserExpression return_value, | 958 V8_INLINE PreParserExpression RewriteReturn(PreParserExpression return_value, |
| 951 int pos) { | 959 int pos) { |
| 952 return return_value; | 960 return return_value; |
| 953 } | 961 } |
| 962 V8_INLINE PreParserStatement RewriteSwitchStatement( |
| 963 PreParserExpression tag, PreParserStatement switch_statement, |
| 964 PreParserStatementList cases, Scope* scope) { |
| 965 return PreParserStatement::Default(); |
| 966 } |
| 954 | 967 |
| 955 V8_INLINE PreParserExpression RewriteDoExpression(PreParserStatement body, | 968 V8_INLINE PreParserExpression RewriteDoExpression(PreParserStatement body, |
| 956 int pos, bool* ok) { | 969 int pos, bool* ok) { |
| 957 return PreParserExpression::Default(); | 970 return PreParserExpression::Default(); |
| 958 } | 971 } |
| 959 | 972 |
| 960 V8_INLINE PreParserStatement InitializeLoop(PreParserStatement loop, | 973 V8_INLINE PreParserStatement InitializeLoop(PreParserStatement loop, |
| 961 PreParserExpression cond, | 974 PreParserExpression cond, |
| 962 PreParserStatement body) { | 975 PreParserStatement body) { |
| 963 return loop; | 976 return loop; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1269 } |
| 1257 | 1270 |
| 1258 V8_INLINE PreParserExpressionList NewPropertyList(int size) const { | 1271 V8_INLINE PreParserExpressionList NewPropertyList(int size) const { |
| 1259 return PreParserExpressionList(); | 1272 return PreParserExpressionList(); |
| 1260 } | 1273 } |
| 1261 | 1274 |
| 1262 V8_INLINE PreParserStatementList NewStatementList(int size) const { | 1275 V8_INLINE PreParserStatementList NewStatementList(int size) const { |
| 1263 return PreParserStatementList(); | 1276 return PreParserStatementList(); |
| 1264 } | 1277 } |
| 1265 | 1278 |
| 1279 PreParserStatementList NewCaseClauseList(int size) { |
| 1280 return PreParserStatementList(); |
| 1281 } |
| 1282 |
| 1266 V8_INLINE static PreParserStatement NewBlock( | 1283 V8_INLINE static PreParserStatement NewBlock( |
| 1267 ZoneList<const AstRawString*>* labels, int capacity, | 1284 ZoneList<const AstRawString*>* labels, int capacity, |
| 1268 bool ignore_completion_value, int pos) { | 1285 bool ignore_completion_value, int pos) { |
| 1269 return PreParserStatement::Default(); | 1286 return PreParserStatement::Default(); |
| 1270 } | 1287 } |
| 1271 | 1288 |
| 1272 V8_INLINE PreParserExpression | 1289 V8_INLINE PreParserExpression |
| 1273 NewV8Intrinsic(PreParserIdentifier name, PreParserExpressionList arguments, | 1290 NewV8Intrinsic(PreParserIdentifier name, PreParserExpressionList arguments, |
| 1274 int pos, bool* ok) { | 1291 int pos, bool* ok) { |
| 1275 return PreParserExpression::Default(); | 1292 return PreParserExpression::Default(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 function_state_->NextMaterializedLiteralIndex(); | 1413 function_state_->NextMaterializedLiteralIndex(); |
| 1397 function_state_->NextMaterializedLiteralIndex(); | 1414 function_state_->NextMaterializedLiteralIndex(); |
| 1398 } | 1415 } |
| 1399 return EmptyExpression(); | 1416 return EmptyExpression(); |
| 1400 } | 1417 } |
| 1401 | 1418 |
| 1402 } // namespace internal | 1419 } // namespace internal |
| 1403 } // namespace v8 | 1420 } // namespace v8 |
| 1404 | 1421 |
| 1405 #endif // V8_PARSING_PREPARSER_H | 1422 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |