| 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 inline void RewriteDestructuringAssignments() {} | 934 inline void RewriteDestructuringAssignments() {} |
| 935 | 935 |
| 936 inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {} | 936 inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {} |
| 937 | 937 |
| 938 void SetFunctionNameFromPropertyName(PreParserExpression, | 938 void SetFunctionNameFromPropertyName(PreParserExpression, |
| 939 PreParserIdentifier) {} | 939 PreParserIdentifier) {} |
| 940 | 940 |
| 941 inline PreParserExpression RewriteNonPattern( | 941 inline PreParserExpression RewriteNonPattern( |
| 942 PreParserExpression expr, const ExpressionClassifier* classifier, | 942 PreParserExpression expr, const ExpressionClassifier* classifier, |
| 943 bool* ok); | 943 bool* ok); |
| 944 inline PreParserExpression RewriteObjectLiteralProperty( | 944 inline PreParserExpression RewriteNonPatternArguments( |
| 945 PreParserExpression args, const ExpressionClassifier* classifier, |
| 946 bool* ok); |
| 947 inline PreParserExpression RewriteNonPatternObjectLiteralProperty( |
| 945 PreParserExpression property, const ExpressionClassifier* classifier, | 948 PreParserExpression property, const ExpressionClassifier* classifier, |
| 946 bool* ok); | 949 bool* ok); |
| 947 | 950 |
| 948 private: | 951 private: |
| 949 PreParser* pre_parser_; | 952 PreParser* pre_parser_; |
| 950 }; | 953 }; |
| 951 | 954 |
| 952 | 955 |
| 953 // Preparsing checks a JavaScript program and emits preparse-data that helps | 956 // Preparsing checks a JavaScript program and emits preparse-data that helps |
| 954 // a later parsing to be faster. | 957 // a later parsing to be faster. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 | 1130 |
| 1128 | 1131 |
| 1129 PreParserExpression PreParserTraits::RewriteNonPattern( | 1132 PreParserExpression PreParserTraits::RewriteNonPattern( |
| 1130 PreParserExpression expr, const ExpressionClassifier* classifier, | 1133 PreParserExpression expr, const ExpressionClassifier* classifier, |
| 1131 bool* ok) { | 1134 bool* ok) { |
| 1132 pre_parser_->ValidateExpression(classifier, ok); | 1135 pre_parser_->ValidateExpression(classifier, ok); |
| 1133 return expr; | 1136 return expr; |
| 1134 } | 1137 } |
| 1135 | 1138 |
| 1136 | 1139 |
| 1137 PreParserExpression PreParserTraits::RewriteObjectLiteralProperty( | 1140 PreParserExpression PreParserTraits::RewriteNonPatternArguments( |
| 1141 PreParserExpression args, const ExpressionClassifier* classifier, |
| 1142 bool* ok) { |
| 1143 pre_parser_->ValidateExpression(classifier, ok); |
| 1144 return args; |
| 1145 } |
| 1146 |
| 1147 |
| 1148 PreParserExpression PreParserTraits::RewriteNonPatternObjectLiteralProperty( |
| 1138 PreParserExpression property, const ExpressionClassifier* classifier, | 1149 PreParserExpression property, const ExpressionClassifier* classifier, |
| 1139 bool* ok) { | 1150 bool* ok) { |
| 1140 pre_parser_->ValidateExpression(classifier, ok); | 1151 pre_parser_->ValidateExpression(classifier, ok); |
| 1141 return property; | 1152 return property; |
| 1142 } | 1153 } |
| 1143 | 1154 |
| 1144 | 1155 |
| 1145 PreParserStatementList PreParser::ParseEagerFunctionBody( | 1156 PreParserStatementList PreParser::ParseEagerFunctionBody( |
| 1146 PreParserIdentifier function_name, int pos, | 1157 PreParserIdentifier function_name, int pos, |
| 1147 const PreParserFormalParameters& parameters, FunctionKind kind, | 1158 const PreParserFormalParameters& parameters, FunctionKind kind, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1161 const PreParserFormalParameters& parameters, FunctionKind kind, | 1172 const PreParserFormalParameters& parameters, FunctionKind kind, |
| 1162 FunctionLiteral::FunctionType function_type, bool* ok) { | 1173 FunctionLiteral::FunctionType function_type, bool* ok) { |
| 1163 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1174 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
| 1164 kind, function_type, ok); | 1175 kind, function_type, ok); |
| 1165 } | 1176 } |
| 1166 | 1177 |
| 1167 } // namespace internal | 1178 } // namespace internal |
| 1168 } // namespace v8 | 1179 } // namespace v8 |
| 1169 | 1180 |
| 1170 #endif // V8_PARSING_PREPARSER_H | 1181 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |