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/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 // Dummy implementation for making expression->somefunc() work in both Parser | 287 // Dummy implementation for making expression->somefunc() work in both Parser |
288 // and PreParser. | 288 // and PreParser. |
289 PreParserExpression* operator->() { return this; } | 289 PreParserExpression* operator->() { return this; } |
290 | 290 |
291 // More dummy implementations of things PreParser doesn't need to track: | 291 // More dummy implementations of things PreParser doesn't need to track: |
292 void set_index(int index) {} // For YieldExpressions | 292 void set_index(int index) {} // For YieldExpressions |
293 void set_should_eager_compile() {} | 293 void set_should_eager_compile() {} |
294 | 294 |
295 int position() const { return RelocInfo::kNoPosition; } | 295 int position() const { return kNoSourcePosition; } |
296 void set_function_token_position(int position) {} | 296 void set_function_token_position(int position) {} |
297 | 297 |
298 private: | 298 private: |
299 enum Type { | 299 enum Type { |
300 kExpression, | 300 kExpression, |
301 kIdentifierExpression, | 301 kIdentifierExpression, |
302 kStringLiteralExpression, | 302 kStringLiteralExpression, |
303 kBinaryOperationExpression, | 303 kBinaryOperationExpression, |
304 kSpreadExpression, | 304 kSpreadExpression, |
305 kObjectLiteralExpression, | 305 kObjectLiteralExpression, |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 const PreParserFormalParameters& parameters, FunctionKind kind, | 1262 const PreParserFormalParameters& parameters, FunctionKind kind, |
1263 FunctionLiteral::FunctionType function_type, bool* ok) { | 1263 FunctionLiteral::FunctionType function_type, bool* ok) { |
1264 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1264 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1265 kind, function_type, ok); | 1265 kind, function_type, ok); |
1266 } | 1266 } |
1267 | 1267 |
1268 } // namespace internal | 1268 } // namespace internal |
1269 } // namespace v8 | 1269 } // namespace v8 |
1270 | 1270 |
1271 #endif // V8_PARSING_PREPARSER_H | 1271 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |