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/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 private: | 591 private: |
592 ZoneList<Expression*> cooked_; | 592 ZoneList<Expression*> cooked_; |
593 ZoneList<Expression*> raw_; | 593 ZoneList<Expression*> raw_; |
594 ZoneList<Expression*> expressions_; | 594 ZoneList<Expression*> expressions_; |
595 int pos_; | 595 int pos_; |
596 }; | 596 }; |
597 | 597 |
598 typedef TemplateLiteral* TemplateLiteralState; | 598 typedef TemplateLiteral* TemplateLiteralState; |
599 | 599 |
600 TemplateLiteralState OpenTemplateLiteral(int pos); | 600 TemplateLiteralState OpenTemplateLiteral(int pos); |
601 void AddTemplateSpan(TemplateLiteralState* state, bool tail); | 601 // "should_cook" means that the span can be "cooked": in tagged template |
| 602 // literals, both the raw and "cooked" representations are available to user |
| 603 // code ("cooked" meaning that escape sequences are converted to their |
| 604 // interpreted values). With the --harmony-template-escapes flag, invalid |
| 605 // escape sequences cause the cooked span to be represented by undefined, |
| 606 // instead of being a syntax error. |
| 607 // "tail" indicates that this span is the last in the literal. |
| 608 void AddTemplateSpan(TemplateLiteralState* state, bool should_cook, |
| 609 bool tail); |
602 void AddTemplateExpression(TemplateLiteralState* state, | 610 void AddTemplateExpression(TemplateLiteralState* state, |
603 Expression* expression); | 611 Expression* expression); |
604 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, | 612 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, |
605 Expression* tag); | 613 Expression* tag); |
606 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); | 614 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); |
607 | 615 |
608 ZoneList<Expression*>* PrepareSpreadArguments(ZoneList<Expression*>* list); | 616 ZoneList<Expression*>* PrepareSpreadArguments(ZoneList<Expression*>* list); |
609 Expression* SpreadCall(Expression* function, ZoneList<Expression*>* args, | 617 Expression* SpreadCall(Expression* function, ZoneList<Expression*>* args, |
610 int pos, Call::PossiblyEval is_possibly_eval); | 618 int pos, Call::PossiblyEval is_possibly_eval); |
611 Expression* SpreadCallNew(Expression* function, ZoneList<Expression*>* args, | 619 Expression* SpreadCallNew(Expression* function, ZoneList<Expression*>* args, |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 | 1210 |
1203 private: | 1211 private: |
1204 ParserTarget** variable_; | 1212 ParserTarget** variable_; |
1205 ParserTarget* previous_; | 1213 ParserTarget* previous_; |
1206 }; | 1214 }; |
1207 | 1215 |
1208 } // namespace internal | 1216 } // namespace internal |
1209 } // namespace v8 | 1217 } // namespace v8 |
1210 | 1218 |
1211 #endif // V8_PARSING_PARSER_H_ | 1219 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |