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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 private: | 579 private: |
580 ZoneList<Expression*> cooked_; | 580 ZoneList<Expression*> cooked_; |
581 ZoneList<Expression*> raw_; | 581 ZoneList<Expression*> raw_; |
582 ZoneList<Expression*> expressions_; | 582 ZoneList<Expression*> expressions_; |
583 int pos_; | 583 int pos_; |
584 }; | 584 }; |
585 | 585 |
586 typedef TemplateLiteral* TemplateLiteralState; | 586 typedef TemplateLiteral* TemplateLiteralState; |
587 | 587 |
588 TemplateLiteralState OpenTemplateLiteral(int pos); | 588 TemplateLiteralState OpenTemplateLiteral(int pos); |
589 void AddTemplateSpan(TemplateLiteralState* state, bool tail); | 589 // "should_cook" means that the span can be "cooked": in tagged template |
| 590 // literals, both the raw and "cooked" representations are available to user |
| 591 // code ("cooked" meaning that escape sequences are converted to their |
| 592 // interpreted values). With the --harmony-template-escapes flag, invalid |
| 593 // escape sequences cause the cooked span to be represented by undefined, |
| 594 // instead of being a syntax error. |
| 595 // "tail" indicates that this span is the last in the literal. |
| 596 void AddTemplateSpan(TemplateLiteralState* state, bool should_cook, |
| 597 bool tail); |
590 void AddTemplateExpression(TemplateLiteralState* state, | 598 void AddTemplateExpression(TemplateLiteralState* state, |
591 Expression* expression); | 599 Expression* expression); |
592 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, | 600 Expression* CloseTemplateLiteral(TemplateLiteralState* state, int start, |
593 Expression* tag); | 601 Expression* tag); |
594 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); | 602 uint32_t ComputeTemplateLiteralHash(const TemplateLiteral* lit); |
595 | 603 |
596 ZoneList<Expression*>* PrepareSpreadArguments(ZoneList<Expression*>* list); | 604 ZoneList<Expression*>* PrepareSpreadArguments(ZoneList<Expression*>* list); |
597 Expression* SpreadCall(Expression* function, ZoneList<Expression*>* args, | 605 Expression* SpreadCall(Expression* function, ZoneList<Expression*>* args, |
598 int pos, Call::PossiblyEval is_possibly_eval); | 606 int pos, Call::PossiblyEval is_possibly_eval); |
599 Expression* SpreadCallNew(Expression* function, ZoneList<Expression*>* args, | 607 Expression* SpreadCallNew(Expression* function, ZoneList<Expression*>* args, |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 | 1186 |
1179 private: | 1187 private: |
1180 ParserTarget** variable_; | 1188 ParserTarget** variable_; |
1181 ParserTarget* previous_; | 1189 ParserTarget* previous_; |
1182 }; | 1190 }; |
1183 | 1191 |
1184 } // namespace internal | 1192 } // namespace internal |
1185 } // namespace v8 | 1193 } // namespace v8 |
1186 | 1194 |
1187 #endif // V8_PARSING_PARSER_H_ | 1195 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |