| 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 PreParserExpression right, | 967 PreParserExpression right, |
| 968 int pos) { | 968 int pos) { |
| 969 return left; | 969 return left; |
| 970 } | 970 } |
| 971 inline PreParserExpression RewriteAssignExponentiation( | 971 inline PreParserExpression RewriteAssignExponentiation( |
| 972 PreParserExpression left, PreParserExpression right, int pos) { | 972 PreParserExpression left, PreParserExpression right, int pos) { |
| 973 return left; | 973 return left; |
| 974 } | 974 } |
| 975 | 975 |
| 976 inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {} | 976 inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {} |
| 977 inline void QueueNonPatternForRewriting(PreParserExpression) {} | 977 inline void QueueNonPatternForRewriting(PreParserExpression, bool* ok) {} |
| 978 | 978 |
| 979 void SetFunctionNameFromPropertyName(PreParserExpression, | 979 void SetFunctionNameFromPropertyName(PreParserExpression, |
| 980 PreParserIdentifier) {} | 980 PreParserIdentifier) {} |
| 981 void SetFunctionNameFromIdentifierRef(PreParserExpression, | 981 void SetFunctionNameFromIdentifierRef(PreParserExpression, |
| 982 PreParserExpression) {} | 982 PreParserExpression) {} |
| 983 | 983 |
| 984 inline void RewriteNonPattern(Type::ExpressionClassifier* classifier, | 984 inline void RewriteNonPattern(Type::ExpressionClassifier* classifier, |
| 985 bool* ok); | 985 bool* ok); |
| 986 | 986 |
| 987 inline PreParserExpression RewriteAwaitExpression(PreParserExpression value, | 987 inline PreParserExpression RewriteAwaitExpression(PreParserExpression value, |
| 988 int pos); | 988 int pos); |
| 989 | 989 |
| 990 V8_INLINE ZoneList<typename Type::ExpressionClassifier::Error>* |
| 991 GetReportedErrorList() const; |
| 990 V8_INLINE Zone* zone() const; | 992 V8_INLINE Zone* zone() const; |
| 991 V8_INLINE ZoneList<PreParserExpression>* GetNonPatternList() const; | 993 V8_INLINE ZoneList<PreParserExpression>* GetNonPatternList() const; |
| 992 | 994 |
| 993 inline PreParserExpression RewriteYieldStar( | 995 inline PreParserExpression RewriteYieldStar( |
| 994 PreParserExpression generator, PreParserExpression expr, int pos); | 996 PreParserExpression generator, PreParserExpression expr, int pos); |
| 995 | 997 |
| 996 private: | 998 private: |
| 997 PreParser* pre_parser_; | 999 PreParser* pre_parser_; |
| 998 }; | 1000 }; |
| 999 | 1001 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 void PreParserTraits::RewriteNonPattern(Type::ExpressionClassifier* classifier, | 1209 void PreParserTraits::RewriteNonPattern(Type::ExpressionClassifier* classifier, |
| 1208 bool* ok) { | 1210 bool* ok) { |
| 1209 pre_parser_->ValidateExpression(classifier, ok); | 1211 pre_parser_->ValidateExpression(classifier, ok); |
| 1210 } | 1212 } |
| 1211 | 1213 |
| 1212 PreParserExpression PreParserTraits::RewriteAwaitExpression( | 1214 PreParserExpression PreParserTraits::RewriteAwaitExpression( |
| 1213 PreParserExpression value, int pos) { | 1215 PreParserExpression value, int pos) { |
| 1214 return value; | 1216 return value; |
| 1215 } | 1217 } |
| 1216 | 1218 |
| 1219 ZoneList<PreParserExpression>* PreParserTraits::GetNonPatternList() const { |
| 1220 return pre_parser_->function_state_->non_patterns_to_rewrite(); |
| 1221 } |
| 1222 |
| 1223 |
| 1224 ZoneList<typename PreParserTraits::Type::ExpressionClassifier::Error>* |
| 1225 PreParserTraits::GetReportedErrorList() const { |
| 1226 return pre_parser_->function_state_->GetReportedErrorList(); |
| 1227 } |
| 1228 |
| 1229 |
| 1217 Zone* PreParserTraits::zone() const { | 1230 Zone* PreParserTraits::zone() const { |
| 1218 return pre_parser_->function_state_->scope()->zone(); | 1231 return pre_parser_->function_state_->scope()->zone(); |
| 1219 } | 1232 } |
| 1220 | 1233 |
| 1221 | 1234 |
| 1222 ZoneList<PreParserExpression>* PreParserTraits::GetNonPatternList() const { | |
| 1223 return pre_parser_->function_state_->non_patterns_to_rewrite(); | |
| 1224 } | |
| 1225 | |
| 1226 | |
| 1227 PreParserExpression PreParserTraits::RewriteYieldStar( | 1235 PreParserExpression PreParserTraits::RewriteYieldStar( |
| 1228 PreParserExpression generator, PreParserExpression expression, int pos) { | 1236 PreParserExpression generator, PreParserExpression expression, int pos) { |
| 1229 return PreParserExpression::Default(); | 1237 return PreParserExpression::Default(); |
| 1230 } | 1238 } |
| 1231 | 1239 |
| 1232 PreParserStatementList PreParser::ParseEagerFunctionBody( | 1240 PreParserStatementList PreParser::ParseEagerFunctionBody( |
| 1233 PreParserIdentifier function_name, int pos, | 1241 PreParserIdentifier function_name, int pos, |
| 1234 const PreParserFormalParameters& parameters, FunctionKind kind, | 1242 const PreParserFormalParameters& parameters, FunctionKind kind, |
| 1235 FunctionLiteral::FunctionType function_type, bool* ok) { | 1243 FunctionLiteral::FunctionType function_type, bool* ok) { |
| 1236 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); | 1244 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1254 const PreParserFormalParameters& parameters, FunctionKind kind, | 1262 const PreParserFormalParameters& parameters, FunctionKind kind, |
| 1255 FunctionLiteral::FunctionType function_type, bool* ok) { | 1263 FunctionLiteral::FunctionType function_type, bool* ok) { |
| 1256 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1264 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
| 1257 kind, function_type, ok); | 1265 kind, function_type, ok); |
| 1258 } | 1266 } |
| 1259 | 1267 |
| 1260 } // namespace internal | 1268 } // namespace internal |
| 1261 } // namespace v8 | 1269 } // namespace v8 |
| 1262 | 1270 |
| 1263 #endif // V8_PARSING_PREPARSER_H | 1271 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |