| 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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 | 884 |
| 885 // Parses a single function literal, from the opening parentheses before | 885 // Parses a single function literal, from the opening parentheses before |
| 886 // parameters to the closing brace after the body. | 886 // parameters to the closing brace after the body. |
| 887 // Returns a FunctionEntry describing the body of the function in enough | 887 // Returns a FunctionEntry describing the body of the function in enough |
| 888 // detail that it can be lazily compiled. | 888 // detail that it can be lazily compiled. |
| 889 // The scanner is expected to have matched the "function" or "function*" | 889 // The scanner is expected to have matched the "function" or "function*" |
| 890 // keyword and parameters, and have consumed the initial '{'. | 890 // keyword and parameters, and have consumed the initial '{'. |
| 891 // At return, unless an error occurred, the scanner is positioned before the | 891 // At return, unless an error occurred, the scanner is positioned before the |
| 892 // the final '}'. | 892 // the final '}'. |
| 893 PreParseResult PreParseLazyFunction(DeclarationScope* function_scope, | 893 PreParseResult PreParseLazyFunction(DeclarationScope* function_scope, |
| 894 bool parsing_module, ParserRecorder* log, | 894 bool parsing_module, SingletonLogger* log, |
| 895 bool track_unresolved_variables, | 895 bool track_unresolved_variables, |
| 896 bool may_abort, int* use_counts); | 896 bool may_abort, int* use_counts); |
| 897 | 897 |
| 898 private: | 898 private: |
| 899 // These types form an algebra over syntactic categories that is just | 899 // These types form an algebra over syntactic categories that is just |
| 900 // rich enough to let us recognize and propagate the constructs that | 900 // rich enough to let us recognize and propagate the constructs that |
| 901 // are either being counted in the preparser data, or is important | 901 // are either being counted in the preparser data, or is important |
| 902 // to throw the correct syntax error exceptions. | 902 // to throw the correct syntax error exceptions. |
| 903 | 903 |
| 904 // All ParseXXX functions take as the last argument an *ok parameter | 904 // All ParseXXX functions take as the last argument an *ok parameter |
| (...skipping 10 matching lines...) Expand all Loading... |
| 915 int* materialized_literal_count, int* expected_property_count, | 915 int* materialized_literal_count, int* expected_property_count, |
| 916 bool track_unresolved_variables, bool may_abort, bool* ok) { | 916 bool track_unresolved_variables, bool may_abort, bool* ok) { |
| 917 UNREACHABLE(); | 917 UNREACHABLE(); |
| 918 return kLazyParsingComplete; | 918 return kLazyParsingComplete; |
| 919 } | 919 } |
| 920 Expression ParseFunctionLiteral( | 920 Expression ParseFunctionLiteral( |
| 921 Identifier name, Scanner::Location function_name_location, | 921 Identifier name, Scanner::Location function_name_location, |
| 922 FunctionNameValidity function_name_validity, FunctionKind kind, | 922 FunctionNameValidity function_name_validity, FunctionKind kind, |
| 923 int function_token_pos, FunctionLiteral::FunctionType function_type, | 923 int function_token_pos, FunctionLiteral::FunctionType function_type, |
| 924 LanguageMode language_mode, bool* ok); | 924 LanguageMode language_mode, bool* ok); |
| 925 LazyParsingResult ParseLazyFunctionLiteralBody(bool may_abort, bool* ok); | 925 LazyParsingResult ParseStatementListAndLogFunction(bool may_abort, bool* ok); |
| 926 | 926 |
| 927 struct TemplateLiteralState {}; | 927 struct TemplateLiteralState {}; |
| 928 | 928 |
| 929 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos) { | 929 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos) { |
| 930 return TemplateLiteralState(); | 930 return TemplateLiteralState(); |
| 931 } | 931 } |
| 932 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, | 932 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, |
| 933 PreParserExpression expression) {} | 933 PreParserExpression expression) {} |
| 934 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail) {} | 934 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail) {} |
| 935 V8_INLINE PreParserExpression CloseTemplateLiteral( | 935 V8_INLINE PreParserExpression CloseTemplateLiteral( |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 function_state_->NextMaterializedLiteralIndex(); | 1541 function_state_->NextMaterializedLiteralIndex(); |
| 1542 function_state_->NextMaterializedLiteralIndex(); | 1542 function_state_->NextMaterializedLiteralIndex(); |
| 1543 } | 1543 } |
| 1544 return EmptyExpression(); | 1544 return EmptyExpression(); |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 } // namespace internal | 1547 } // namespace internal |
| 1548 } // namespace v8 | 1548 } // namespace v8 |
| 1549 | 1549 |
| 1550 #endif // V8_PARSING_PREPARSER_H | 1550 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |