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_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 | 902 |
903 // Rewrite all DestructuringAssignments in the current FunctionState. | 903 // Rewrite all DestructuringAssignments in the current FunctionState. |
904 V8_INLINE void RewriteDestructuringAssignments(); | 904 V8_INLINE void RewriteDestructuringAssignments(); |
905 | 905 |
906 V8_INLINE void QueueDestructuringAssignmentForRewriting( | 906 V8_INLINE void QueueDestructuringAssignmentForRewriting( |
907 Expression* assignment); | 907 Expression* assignment); |
908 | 908 |
909 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 909 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
910 const AstRawString* name); | 910 const AstRawString* name); |
911 | 911 |
| 912 // Rewrite expressions |
| 913 V8_INLINE Expression* RewriteExpression(Expression* expr); |
| 914 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty( |
| 915 ObjectLiteralProperty* property); |
| 916 |
912 private: | 917 private: |
913 Parser* parser_; | 918 Parser* parser_; |
914 }; | 919 }; |
915 | 920 |
916 | 921 |
917 class Parser : public ParserBase<ParserTraits> { | 922 class Parser : public ParserBase<ParserTraits> { |
918 public: | 923 public: |
919 explicit Parser(ParseInfo* info); | 924 explicit Parser(ParseInfo* info); |
920 ~Parser() { | 925 ~Parser() { |
921 delete reusable_preparser_; | 926 delete reusable_preparser_; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 Expression* SpreadCall(Expression* function, | 1259 Expression* SpreadCall(Expression* function, |
1255 ZoneList<v8::internal::Expression*>* args, int pos); | 1260 ZoneList<v8::internal::Expression*>* args, int pos); |
1256 Expression* SpreadCallNew(Expression* function, | 1261 Expression* SpreadCallNew(Expression* function, |
1257 ZoneList<v8::internal::Expression*>* args, int pos); | 1262 ZoneList<v8::internal::Expression*>* args, int pos); |
1258 | 1263 |
1259 void SetLanguageMode(Scope* scope, LanguageMode mode); | 1264 void SetLanguageMode(Scope* scope, LanguageMode mode); |
1260 void RaiseLanguageMode(LanguageMode mode); | 1265 void RaiseLanguageMode(LanguageMode mode); |
1261 | 1266 |
1262 V8_INLINE void RewriteDestructuringAssignments(); | 1267 V8_INLINE void RewriteDestructuringAssignments(); |
1263 | 1268 |
| 1269 V8_INLINE Expression* RewriteExpression(Expression* expr); |
| 1270 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty( |
| 1271 ObjectLiteralProperty* property); |
| 1272 |
1264 friend class InitializerRewriter; | 1273 friend class InitializerRewriter; |
1265 void RewriteParameterInitializer(Expression* expr, Scope* scope); | 1274 void RewriteParameterInitializer(Expression* expr, Scope* scope); |
1266 | 1275 |
1267 Scanner scanner_; | 1276 Scanner scanner_; |
1268 PreParser* reusable_preparser_; | 1277 PreParser* reusable_preparser_; |
1269 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 1278 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
1270 Target* target_stack_; // for break, continue statements | 1279 Target* target_stack_; // for break, continue statements |
1271 ScriptCompiler::CompileOptions compile_options_; | 1280 ScriptCompiler::CompileOptions compile_options_; |
1272 ParseData* cached_parse_data_; | 1281 ParseData* cached_parse_data_; |
1273 | 1282 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 | 1459 |
1451 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1460 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1452 return parser_->ParseDoExpression(ok); | 1461 return parser_->ParseDoExpression(ok); |
1453 } | 1462 } |
1454 | 1463 |
1455 | 1464 |
1456 } // namespace internal | 1465 } // namespace internal |
1457 } // namespace v8 | 1466 } // namespace v8 |
1458 | 1467 |
1459 #endif // V8_PARSING_PARSER_H_ | 1468 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |