Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: src/preparser.h

Issue 658423002: Unship ES6 iteration and unscopables on 3.28 (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.28
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/func-name-inferrer.h" 10 #include "src/func-name-inferrer.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 extension_(extension), 74 extension_(extension),
75 fni_(NULL), 75 fni_(NULL),
76 log_(log), 76 log_(log),
77 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. 77 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
78 scanner_(scanner), 78 scanner_(scanner),
79 stack_limit_(stack_limit), 79 stack_limit_(stack_limit),
80 stack_overflow_(false), 80 stack_overflow_(false),
81 allow_lazy_(false), 81 allow_lazy_(false),
82 allow_natives_syntax_(false), 82 allow_natives_syntax_(false),
83 allow_generators_(false), 83 allow_generators_(false),
84 allow_for_of_(false),
84 allow_arrow_functions_(false), 85 allow_arrow_functions_(false),
85 zone_(zone) {} 86 zone_(zone) {}
86 87
87 // Getters that indicate whether certain syntactical constructs are 88 // Getters that indicate whether certain syntactical constructs are
88 // allowed to be parsed by this instance of the parser. 89 // allowed to be parsed by this instance of the parser.
89 bool allow_lazy() const { return allow_lazy_; } 90 bool allow_lazy() const { return allow_lazy_; }
90 bool allow_natives_syntax() const { return allow_natives_syntax_; } 91 bool allow_natives_syntax() const { return allow_natives_syntax_; }
91 bool allow_generators() const { return allow_generators_; } 92 bool allow_generators() const { return allow_generators_; }
93 bool allow_for_of() const { return allow_for_of_; }
92 bool allow_arrow_functions() const { return allow_arrow_functions_; } 94 bool allow_arrow_functions() const { return allow_arrow_functions_; }
93 bool allow_modules() const { return scanner()->HarmonyModules(); } 95 bool allow_modules() const { return scanner()->HarmonyModules(); }
94 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); } 96 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); }
95 bool allow_harmony_numeric_literals() const { 97 bool allow_harmony_numeric_literals() const {
96 return scanner()->HarmonyNumericLiterals(); 98 return scanner()->HarmonyNumericLiterals();
97 } 99 }
98 100
99 // Setters that determine whether certain syntactical constructs are 101 // Setters that determine whether certain syntactical constructs are
100 // allowed to be parsed by this instance of the parser. 102 // allowed to be parsed by this instance of the parser.
101 void set_allow_lazy(bool allow) { allow_lazy_ = allow; } 103 void set_allow_lazy(bool allow) { allow_lazy_ = allow; }
102 void set_allow_natives_syntax(bool allow) { allow_natives_syntax_ = allow; } 104 void set_allow_natives_syntax(bool allow) { allow_natives_syntax_ = allow; }
103 void set_allow_generators(bool allow) { allow_generators_ = allow; } 105 void set_allow_generators(bool allow) { allow_generators_ = allow; }
106 void set_allow_for_of(bool allow) { allow_for_of_ = allow; }
104 void set_allow_arrow_functions(bool allow) { allow_arrow_functions_ = allow; } 107 void set_allow_arrow_functions(bool allow) { allow_arrow_functions_ = allow; }
105 void set_allow_modules(bool allow) { scanner()->SetHarmonyModules(allow); } 108 void set_allow_modules(bool allow) { scanner()->SetHarmonyModules(allow); }
106 void set_allow_harmony_scoping(bool allow) { 109 void set_allow_harmony_scoping(bool allow) {
107 scanner()->SetHarmonyScoping(allow); 110 scanner()->SetHarmonyScoping(allow);
108 } 111 }
109 void set_allow_harmony_numeric_literals(bool allow) { 112 void set_allow_harmony_numeric_literals(bool allow) {
110 scanner()->SetHarmonyNumericLiterals(allow); 113 scanner()->SetHarmonyNumericLiterals(allow);
111 } 114 }
112 115
113 protected: 116 protected:
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 Mode mode_; 563 Mode mode_;
561 564
562 private: 565 private:
563 Scanner* scanner_; 566 Scanner* scanner_;
564 uintptr_t stack_limit_; 567 uintptr_t stack_limit_;
565 bool stack_overflow_; 568 bool stack_overflow_;
566 569
567 bool allow_lazy_; 570 bool allow_lazy_;
568 bool allow_natives_syntax_; 571 bool allow_natives_syntax_;
569 bool allow_generators_; 572 bool allow_generators_;
573 bool allow_for_of_;
570 bool allow_arrow_functions_; 574 bool allow_arrow_functions_;
571 575
572 typename Traits::Type::Zone* zone_; // Only used by Parser. 576 typename Traits::Type::Zone* zone_; // Only used by Parser.
573 }; 577 };
574 578
575 579
576 class PreParserIdentifier { 580 class PreParserIdentifier {
577 public: 581 public:
578 PreParserIdentifier() : type_(kUnknownIdentifier) {} 582 PreParserIdentifier() : type_(kUnknownIdentifier) {}
579 static PreParserIdentifier Default() { 583 static PreParserIdentifier Default() {
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 parser()->ReportMessage("accessor_get_set"); 2658 parser()->ReportMessage("accessor_get_set");
2655 } 2659 }
2656 *ok = false; 2660 *ok = false;
2657 } 2661 }
2658 } 2662 }
2659 2663
2660 2664
2661 } } // v8::internal 2665 } } // v8::internal
2662 2666
2663 #endif // V8_PREPARSER_H 2667 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698