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_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/ast/ast-types.h" | 8 #include "src/ast/ast-types.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 | 2571 |
2572 enum ParameterFlag { kNoDuplicateParameters, kHasDuplicateParameters }; | 2572 enum ParameterFlag { kNoDuplicateParameters, kHasDuplicateParameters }; |
2573 | 2573 |
2574 enum EagerCompileHint { kShouldEagerCompile, kShouldLazyCompile }; | 2574 enum EagerCompileHint { kShouldEagerCompile, kShouldLazyCompile }; |
2575 | 2575 |
2576 Handle<String> name() const { return raw_name_->string(); } | 2576 Handle<String> name() const { return raw_name_->string(); } |
2577 const AstString* raw_name() const { return raw_name_; } | 2577 const AstString* raw_name() const { return raw_name_; } |
2578 void set_raw_name(const AstString* name) { raw_name_ = name; } | 2578 void set_raw_name(const AstString* name) { raw_name_ = name; } |
2579 DeclarationScope* scope() const { return scope_; } | 2579 DeclarationScope* scope() const { return scope_; } |
2580 ZoneList<Statement*>* body() const { return body_; } | 2580 ZoneList<Statement*>* body() const { return body_; } |
| 2581 void set_body(ZoneList<Statement*>* body) { body_ = body; } |
2581 void set_function_token_position(int pos) { function_token_position_ = pos; } | 2582 void set_function_token_position(int pos) { function_token_position_ = pos; } |
2582 int function_token_position() const { return function_token_position_; } | 2583 int function_token_position() const { return function_token_position_; } |
2583 int start_position() const; | 2584 int start_position() const; |
2584 int end_position() const; | 2585 int end_position() const; |
2585 int SourceSize() const { return end_position() - start_position(); } | 2586 int SourceSize() const { return end_position() - start_position(); } |
2586 bool is_declaration() const { return function_type() == kDeclaration; } | 2587 bool is_declaration() const { return function_type() == kDeclaration; } |
2587 bool is_named_expression() const { | 2588 bool is_named_expression() const { |
2588 return function_type() == kNamedExpression; | 2589 return function_type() == kNamedExpression; |
2589 } | 2590 } |
2590 bool is_anonymous_expression() const { | 2591 bool is_anonymous_expression() const { |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3601 : NULL; \ | 3602 : NULL; \ |
3602 } | 3603 } |
3603 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3604 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3604 #undef DECLARE_NODE_FUNCTIONS | 3605 #undef DECLARE_NODE_FUNCTIONS |
3605 | 3606 |
3606 | 3607 |
3607 } // namespace internal | 3608 } // namespace internal |
3608 } // namespace v8 | 3609 } // namespace v8 |
3609 | 3610 |
3610 #endif // V8_AST_AST_H_ | 3611 #endif // V8_AST_AST_H_ |
OLD | NEW |