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_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 scanner_(scanner), | 191 scanner_(scanner), |
192 stack_overflow_(false), | 192 stack_overflow_(false), |
193 allow_lazy_(false), | 193 allow_lazy_(false), |
194 allow_natives_(false), | 194 allow_natives_(false), |
195 allow_tailcalls_(false), | 195 allow_tailcalls_(false), |
196 allow_harmony_restrictive_declarations_(false), | 196 allow_harmony_restrictive_declarations_(false), |
197 allow_harmony_do_expressions_(false), | 197 allow_harmony_do_expressions_(false), |
198 allow_harmony_for_in_(false), | 198 allow_harmony_for_in_(false), |
199 allow_harmony_function_name_(false), | 199 allow_harmony_function_name_(false), |
200 allow_harmony_function_sent_(false), | 200 allow_harmony_function_sent_(false), |
201 allow_harmony_async_await_(false) {} | 201 allow_harmony_async_await_(false), |
| 202 allow_harmony_restrictive_generators_(false) {} |
202 | 203 |
203 #define ALLOW_ACCESSORS(name) \ | 204 #define ALLOW_ACCESSORS(name) \ |
204 bool allow_##name() const { return allow_##name##_; } \ | 205 bool allow_##name() const { return allow_##name##_; } \ |
205 void set_allow_##name(bool allow) { allow_##name##_ = allow; } | 206 void set_allow_##name(bool allow) { allow_##name##_ = allow; } |
206 | 207 |
207 #define SCANNER_ACCESSORS(name) \ | 208 #define SCANNER_ACCESSORS(name) \ |
208 bool allow_##name() const { return scanner_->allow_##name(); } \ | 209 bool allow_##name() const { return scanner_->allow_##name(); } \ |
209 void set_allow_##name(bool allow) { \ | 210 void set_allow_##name(bool allow) { \ |
210 return scanner_->set_allow_##name(allow); \ | 211 return scanner_->set_allow_##name(allow); \ |
211 } | 212 } |
212 | 213 |
213 ALLOW_ACCESSORS(lazy); | 214 ALLOW_ACCESSORS(lazy); |
214 ALLOW_ACCESSORS(natives); | 215 ALLOW_ACCESSORS(natives); |
215 ALLOW_ACCESSORS(tailcalls); | 216 ALLOW_ACCESSORS(tailcalls); |
216 ALLOW_ACCESSORS(harmony_restrictive_declarations); | 217 ALLOW_ACCESSORS(harmony_restrictive_declarations); |
217 ALLOW_ACCESSORS(harmony_do_expressions); | 218 ALLOW_ACCESSORS(harmony_do_expressions); |
218 ALLOW_ACCESSORS(harmony_for_in); | 219 ALLOW_ACCESSORS(harmony_for_in); |
219 ALLOW_ACCESSORS(harmony_function_name); | 220 ALLOW_ACCESSORS(harmony_function_name); |
220 ALLOW_ACCESSORS(harmony_function_sent); | 221 ALLOW_ACCESSORS(harmony_function_sent); |
221 ALLOW_ACCESSORS(harmony_async_await); | 222 ALLOW_ACCESSORS(harmony_async_await); |
| 223 ALLOW_ACCESSORS(harmony_restrictive_generators); |
222 SCANNER_ACCESSORS(harmony_exponentiation_operator); | 224 SCANNER_ACCESSORS(harmony_exponentiation_operator); |
223 | 225 |
224 #undef SCANNER_ACCESSORS | 226 #undef SCANNER_ACCESSORS |
225 #undef ALLOW_ACCESSORS | 227 #undef ALLOW_ACCESSORS |
226 | 228 |
227 uintptr_t stack_limit() const { return stack_limit_; } | 229 uintptr_t stack_limit() const { return stack_limit_; } |
228 | 230 |
229 protected: | 231 protected: |
230 enum AllowRestrictedIdentifiers { | 232 enum AllowRestrictedIdentifiers { |
231 kAllowRestrictedIdentifiers, | 233 kAllowRestrictedIdentifiers, |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 | 1171 |
1170 bool allow_lazy_; | 1172 bool allow_lazy_; |
1171 bool allow_natives_; | 1173 bool allow_natives_; |
1172 bool allow_tailcalls_; | 1174 bool allow_tailcalls_; |
1173 bool allow_harmony_restrictive_declarations_; | 1175 bool allow_harmony_restrictive_declarations_; |
1174 bool allow_harmony_do_expressions_; | 1176 bool allow_harmony_do_expressions_; |
1175 bool allow_harmony_for_in_; | 1177 bool allow_harmony_for_in_; |
1176 bool allow_harmony_function_name_; | 1178 bool allow_harmony_function_name_; |
1177 bool allow_harmony_function_sent_; | 1179 bool allow_harmony_function_sent_; |
1178 bool allow_harmony_async_await_; | 1180 bool allow_harmony_async_await_; |
| 1181 bool allow_harmony_restrictive_generators_; |
1179 }; | 1182 }; |
1180 | 1183 |
1181 template <class Traits> | 1184 template <class Traits> |
1182 ParserBase<Traits>::FunctionState::FunctionState( | 1185 ParserBase<Traits>::FunctionState::FunctionState( |
1183 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope, | 1186 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope, |
1184 FunctionKind kind, typename Traits::Type::Factory* factory) | 1187 FunctionKind kind, typename Traits::Type::Factory* factory) |
1185 : next_materialized_literal_index_(0), | 1188 : next_materialized_literal_index_(0), |
1186 expected_property_count_(0), | 1189 expected_property_count_(0), |
1187 this_location_(Scanner::Location::invalid()), | 1190 this_location_(Scanner::Location::invalid()), |
1188 return_location_(Scanner::Location::invalid()), | 1191 return_location_(Scanner::Location::invalid()), |
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3593 has_seen_constructor_ = true; | 3596 has_seen_constructor_ = true; |
3594 return; | 3597 return; |
3595 } | 3598 } |
3596 } | 3599 } |
3597 | 3600 |
3598 | 3601 |
3599 } // namespace internal | 3602 } // namespace internal |
3600 } // namespace v8 | 3603 } // namespace v8 |
3601 | 3604 |
3602 #endif // V8_PARSING_PARSER_BASE_H | 3605 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |