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/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 | 930 |
931 inline PreParserExpression RewriteNonPattern( | 931 inline PreParserExpression RewriteNonPattern( |
932 PreParserExpression expr, const ExpressionClassifier* classifier, | 932 PreParserExpression expr, const ExpressionClassifier* classifier, |
933 bool* ok); | 933 bool* ok); |
934 inline PreParserExpression RewriteNonPatternObjectLiteralProperty( | 934 inline PreParserExpression RewriteNonPatternObjectLiteralProperty( |
935 PreParserExpression property, const ExpressionClassifier* classifier, | 935 PreParserExpression property, const ExpressionClassifier* classifier, |
936 bool* ok); | 936 bool* ok); |
937 | 937 |
938 inline PreParserExpression RewriteYieldStar( | 938 inline PreParserExpression RewriteYieldStar( |
939 PreParserExpression generator, PreParserExpression expr, int pos); | 939 PreParserExpression generator, PreParserExpression expr, int pos); |
| 940 inline PreParserExpression RewriteInstanceof(PreParserExpression lhs, |
| 941 PreParserExpression rhs, |
| 942 int pos); |
940 | 943 |
941 private: | 944 private: |
942 PreParser* pre_parser_; | 945 PreParser* pre_parser_; |
943 }; | 946 }; |
944 | 947 |
945 | 948 |
946 // Preparsing checks a JavaScript program and emits preparse-data that helps | 949 // Preparsing checks a JavaScript program and emits preparse-data that helps |
947 // a later parsing to be faster. | 950 // a later parsing to be faster. |
948 // See preparse-data-format.h for the data format. | 951 // See preparse-data-format.h for the data format. |
949 | 952 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 return property; | 1137 return property; |
1135 } | 1138 } |
1136 | 1139 |
1137 | 1140 |
1138 PreParserExpression PreParserTraits::RewriteYieldStar( | 1141 PreParserExpression PreParserTraits::RewriteYieldStar( |
1139 PreParserExpression generator, PreParserExpression expression, int pos) { | 1142 PreParserExpression generator, PreParserExpression expression, int pos) { |
1140 return pre_parser_->factory()->NewYield( | 1143 return pre_parser_->factory()->NewYield( |
1141 generator, expression, Yield::kDelegating, pos); | 1144 generator, expression, Yield::kDelegating, pos); |
1142 } | 1145 } |
1143 | 1146 |
| 1147 PreParserExpression PreParserTraits::RewriteInstanceof(PreParserExpression lhs, |
| 1148 PreParserExpression rhs, |
| 1149 int pos) { |
| 1150 return PreParserExpression::Default(); |
| 1151 } |
1144 | 1152 |
1145 PreParserStatementList PreParser::ParseEagerFunctionBody( | 1153 PreParserStatementList PreParser::ParseEagerFunctionBody( |
1146 PreParserIdentifier function_name, int pos, | 1154 PreParserIdentifier function_name, int pos, |
1147 const PreParserFormalParameters& parameters, FunctionKind kind, | 1155 const PreParserFormalParameters& parameters, FunctionKind kind, |
1148 FunctionLiteral::FunctionType function_type, bool* ok) { | 1156 FunctionLiteral::FunctionType function_type, bool* ok) { |
1149 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); | 1157 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); |
1150 | 1158 |
1151 ParseStatementList(Token::RBRACE, ok); | 1159 ParseStatementList(Token::RBRACE, ok); |
1152 if (!*ok) return PreParserStatementList(); | 1160 if (!*ok) return PreParserStatementList(); |
1153 | 1161 |
1154 Expect(Token::RBRACE, ok); | 1162 Expect(Token::RBRACE, ok); |
1155 return PreParserStatementList(); | 1163 return PreParserStatementList(); |
1156 } | 1164 } |
1157 | 1165 |
1158 | 1166 |
1159 PreParserStatementList PreParserTraits::ParseEagerFunctionBody( | 1167 PreParserStatementList PreParserTraits::ParseEagerFunctionBody( |
1160 PreParserIdentifier function_name, int pos, | 1168 PreParserIdentifier function_name, int pos, |
1161 const PreParserFormalParameters& parameters, FunctionKind kind, | 1169 const PreParserFormalParameters& parameters, FunctionKind kind, |
1162 FunctionLiteral::FunctionType function_type, bool* ok) { | 1170 FunctionLiteral::FunctionType function_type, bool* ok) { |
1163 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1171 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1164 kind, function_type, ok); | 1172 kind, function_type, ok); |
1165 } | 1173 } |
1166 | 1174 |
1167 } // namespace internal | 1175 } // namespace internal |
1168 } // namespace v8 | 1176 } // namespace v8 |
1169 | 1177 |
1170 #endif // V8_PARSING_PREPARSER_H | 1178 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |