| 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/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 allow_harmony_for_in_(false), | 222 allow_harmony_for_in_(false), |
| 223 allow_harmony_function_sent_(false), | 223 allow_harmony_function_sent_(false), |
| 224 allow_harmony_async_await_(false), | 224 allow_harmony_async_await_(false), |
| 225 allow_harmony_restrictive_generators_(false), | 225 allow_harmony_restrictive_generators_(false), |
| 226 allow_harmony_trailing_commas_(false) {} | 226 allow_harmony_trailing_commas_(false) {} |
| 227 | 227 |
| 228 #define ALLOW_ACCESSORS(name) \ | 228 #define ALLOW_ACCESSORS(name) \ |
| 229 bool allow_##name() const { return allow_##name##_; } \ | 229 bool allow_##name() const { return allow_##name##_; } \ |
| 230 void set_allow_##name(bool allow) { allow_##name##_ = allow; } | 230 void set_allow_##name(bool allow) { allow_##name##_ = allow; } |
| 231 | 231 |
| 232 #define SCANNER_ACCESSORS(name) \ | |
| 233 bool allow_##name() const { return scanner_->allow_##name(); } \ | |
| 234 void set_allow_##name(bool allow) { \ | |
| 235 return scanner_->set_allow_##name(allow); \ | |
| 236 } | |
| 237 | |
| 238 ALLOW_ACCESSORS(lazy); | 232 ALLOW_ACCESSORS(lazy); |
| 239 ALLOW_ACCESSORS(natives); | 233 ALLOW_ACCESSORS(natives); |
| 240 ALLOW_ACCESSORS(tailcalls); | 234 ALLOW_ACCESSORS(tailcalls); |
| 241 ALLOW_ACCESSORS(harmony_restrictive_declarations); | 235 ALLOW_ACCESSORS(harmony_restrictive_declarations); |
| 242 ALLOW_ACCESSORS(harmony_do_expressions); | 236 ALLOW_ACCESSORS(harmony_do_expressions); |
| 243 ALLOW_ACCESSORS(harmony_for_in); | 237 ALLOW_ACCESSORS(harmony_for_in); |
| 244 ALLOW_ACCESSORS(harmony_function_sent); | 238 ALLOW_ACCESSORS(harmony_function_sent); |
| 245 ALLOW_ACCESSORS(harmony_async_await); | 239 ALLOW_ACCESSORS(harmony_async_await); |
| 246 ALLOW_ACCESSORS(harmony_restrictive_generators); | 240 ALLOW_ACCESSORS(harmony_restrictive_generators); |
| 247 ALLOW_ACCESSORS(harmony_trailing_commas); | 241 ALLOW_ACCESSORS(harmony_trailing_commas); |
| 248 SCANNER_ACCESSORS(harmony_exponentiation_operator); | |
| 249 | 242 |
| 250 #undef SCANNER_ACCESSORS | |
| 251 #undef ALLOW_ACCESSORS | 243 #undef ALLOW_ACCESSORS |
| 252 | 244 |
| 253 uintptr_t stack_limit() const { return stack_limit_; } | 245 uintptr_t stack_limit() const { return stack_limit_; } |
| 254 | 246 |
| 255 void set_stack_limit(uintptr_t stack_limit) { stack_limit_ = stack_limit; } | 247 void set_stack_limit(uintptr_t stack_limit) { stack_limit_ = stack_limit; } |
| 256 | 248 |
| 257 protected: | 249 protected: |
| 258 enum AllowRestrictedIdentifiers { | 250 enum AllowRestrictedIdentifiers { |
| 259 kAllowRestrictedIdentifiers, | 251 kAllowRestrictedIdentifiers, |
| 260 kDontAllowRestrictedIdentifiers | 252 kDontAllowRestrictedIdentifiers |
| (...skipping 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3677 has_seen_constructor_ = true; | 3669 has_seen_constructor_ = true; |
| 3678 return; | 3670 return; |
| 3679 } | 3671 } |
| 3680 } | 3672 } |
| 3681 | 3673 |
| 3682 | 3674 |
| 3683 } // namespace internal | 3675 } // namespace internal |
| 3684 } // namespace v8 | 3676 } // namespace v8 |
| 3685 | 3677 |
| 3686 #endif // V8_PARSING_PARSER_BASE_H | 3678 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |