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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
(...skipping 614 matching lines...) Loading... |
625 | 625 |
626 typedef TemplateLiteral* TemplateLiteralState; | 626 typedef TemplateLiteral* TemplateLiteralState; |
627 | 627 |
628 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos); | 628 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos); |
629 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail); | 629 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail); |
630 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, | 630 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, |
631 Expression* expression); | 631 Expression* expression); |
632 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state, | 632 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state, |
633 int start, Expression* tag); | 633 int start, Expression* tag); |
634 V8_INLINE Expression* NoTemplateTag() { return NULL; } | 634 V8_INLINE Expression* NoTemplateTag() { return NULL; } |
| 635 V8_INLINE static bool IsTaggedTemplate(const Expression* tag) { |
| 636 return tag != NULL; |
| 637 } |
635 | 638 |
636 private: | 639 private: |
637 Parser* parser_; | 640 Parser* parser_; |
638 }; | 641 }; |
639 | 642 |
640 | 643 |
641 class Parser : public ParserBase<ParserTraits> { | 644 class Parser : public ParserBase<ParserTraits> { |
642 public: | 645 public: |
643 // Note that the hash seed in ParseInfo must be the hash seed from the | 646 // Note that the hash seed in ParseInfo must be the hash seed from the |
644 // Isolate's heap, otherwise the heap will be in an inconsistent state once | 647 // Isolate's heap, otherwise the heap will be in an inconsistent state once |
(...skipping 355 matching lines...) Loading... |
1000 } | 1003 } |
1001 | 1004 |
1002 | 1005 |
1003 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 1006 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
1004 int start, Expression* tag) { | 1007 int start, Expression* tag) { |
1005 return parser_->CloseTemplateLiteral(state, start, tag); | 1008 return parser_->CloseTemplateLiteral(state, start, tag); |
1006 } | 1009 } |
1007 } } // namespace v8::internal | 1010 } } // namespace v8::internal |
1008 | 1011 |
1009 #endif // V8_PARSER_H_ | 1012 #endif // V8_PARSER_H_ |
OLD | NEW |