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_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // ! <literal> -> true / false | 437 // ! <literal> -> true / false |
438 // The following rewriting rules enable the collection of type feedback | 438 // The following rewriting rules enable the collection of type feedback |
439 // without any special stub and the multiplication is removed later in | 439 // without any special stub and the multiplication is removed later in |
440 // Crankshaft's canonicalization pass. | 440 // Crankshaft's canonicalization pass. |
441 // + foo -> foo * 1 | 441 // + foo -> foo * 1 |
442 // - foo -> foo * (-1) | 442 // - foo -> foo * (-1) |
443 // ~ foo -> foo ^(~0) | 443 // ~ foo -> foo ^(~0) |
444 Expression* BuildUnaryExpression(Expression* expression, Token::Value op, | 444 Expression* BuildUnaryExpression(Expression* expression, Token::Value op, |
445 int pos, AstNodeFactory* factory); | 445 int pos, AstNodeFactory* factory); |
446 | 446 |
| 447 Expression* BuildIteratorResult(Expression* value, bool done); |
| 448 |
447 // Generate AST node that throws a ReferenceError with the given type. | 449 // Generate AST node that throws a ReferenceError with the given type. |
448 Expression* NewThrowReferenceError(MessageTemplate::Template message, | 450 Expression* NewThrowReferenceError(MessageTemplate::Template message, |
449 int pos); | 451 int pos); |
450 | 452 |
451 // Generate AST node that throws a SyntaxError with the given | 453 // Generate AST node that throws a SyntaxError with the given |
452 // type. The first argument may be null (in the handle sense) in | 454 // type. The first argument may be null (in the handle sense) in |
453 // which case no arguments are passed to the constructor. | 455 // which case no arguments are passed to the constructor. |
454 Expression* NewThrowSyntaxError(MessageTemplate::Template message, | 456 Expression* NewThrowSyntaxError(MessageTemplate::Template message, |
455 const AstRawString* arg, int pos); | 457 const AstRawString* arg, int pos); |
456 | 458 |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 | 1231 |
1230 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1232 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1231 return parser_->ParseDoExpression(ok); | 1233 return parser_->ParseDoExpression(ok); |
1232 } | 1234 } |
1233 | 1235 |
1234 | 1236 |
1235 } // namespace internal | 1237 } // namespace internal |
1236 } // namespace v8 | 1238 } // namespace v8 |
1237 | 1239 |
1238 #endif // V8_PARSING_PARSER_H_ | 1240 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |