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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 scanner_(scanner), | 107 scanner_(scanner), |
108 stack_overflow_(false), | 108 stack_overflow_(false), |
109 allow_lazy_(false), | 109 allow_lazy_(false), |
110 allow_natives_(false), | 110 allow_natives_(false), |
111 allow_harmony_sloppy_(false), | 111 allow_harmony_sloppy_(false), |
112 allow_harmony_sloppy_function_(false), | 112 allow_harmony_sloppy_function_(false), |
113 allow_harmony_sloppy_let_(false), | 113 allow_harmony_sloppy_let_(false), |
114 allow_harmony_default_parameters_(false), | 114 allow_harmony_default_parameters_(false), |
115 allow_harmony_destructuring_bind_(false), | 115 allow_harmony_destructuring_bind_(false), |
116 allow_harmony_destructuring_assignment_(false), | 116 allow_harmony_destructuring_assignment_(false), |
| 117 allow_harmony_restrictive_declarations_(false), |
117 allow_strong_mode_(false), | 118 allow_strong_mode_(false), |
118 allow_legacy_const_(true), | 119 allow_legacy_const_(true), |
119 allow_harmony_do_expressions_(false), | 120 allow_harmony_do_expressions_(false), |
120 allow_harmony_function_name_(false), | 121 allow_harmony_function_name_(false), |
121 allow_harmony_function_sent_(false) {} | 122 allow_harmony_function_sent_(false) {} |
122 | 123 |
123 #define ALLOW_ACCESSORS(name) \ | 124 #define ALLOW_ACCESSORS(name) \ |
124 bool allow_##name() const { return allow_##name##_; } \ | 125 bool allow_##name() const { return allow_##name##_; } \ |
125 void set_allow_##name(bool allow) { allow_##name##_ = allow; } | 126 void set_allow_##name(bool allow) { allow_##name##_ = allow; } |
126 | 127 |
127 ALLOW_ACCESSORS(lazy); | 128 ALLOW_ACCESSORS(lazy); |
128 ALLOW_ACCESSORS(natives); | 129 ALLOW_ACCESSORS(natives); |
129 ALLOW_ACCESSORS(harmony_sloppy); | 130 ALLOW_ACCESSORS(harmony_sloppy); |
130 ALLOW_ACCESSORS(harmony_sloppy_function); | 131 ALLOW_ACCESSORS(harmony_sloppy_function); |
131 ALLOW_ACCESSORS(harmony_sloppy_let); | 132 ALLOW_ACCESSORS(harmony_sloppy_let); |
132 ALLOW_ACCESSORS(harmony_default_parameters); | 133 ALLOW_ACCESSORS(harmony_default_parameters); |
133 ALLOW_ACCESSORS(harmony_destructuring_bind); | 134 ALLOW_ACCESSORS(harmony_destructuring_bind); |
134 ALLOW_ACCESSORS(harmony_destructuring_assignment); | 135 ALLOW_ACCESSORS(harmony_destructuring_assignment); |
| 136 ALLOW_ACCESSORS(harmony_restrictive_declarations); |
135 ALLOW_ACCESSORS(strong_mode); | 137 ALLOW_ACCESSORS(strong_mode); |
136 ALLOW_ACCESSORS(legacy_const); | 138 ALLOW_ACCESSORS(legacy_const); |
137 ALLOW_ACCESSORS(harmony_do_expressions); | 139 ALLOW_ACCESSORS(harmony_do_expressions); |
138 ALLOW_ACCESSORS(harmony_function_name); | 140 ALLOW_ACCESSORS(harmony_function_name); |
139 ALLOW_ACCESSORS(harmony_function_sent); | 141 ALLOW_ACCESSORS(harmony_function_sent); |
140 #undef ALLOW_ACCESSORS | 142 #undef ALLOW_ACCESSORS |
141 | 143 |
142 uintptr_t stack_limit() const { return stack_limit_; } | 144 uintptr_t stack_limit() const { return stack_limit_; } |
143 | 145 |
144 protected: | 146 protected: |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 bool stack_overflow_; | 946 bool stack_overflow_; |
945 | 947 |
946 bool allow_lazy_; | 948 bool allow_lazy_; |
947 bool allow_natives_; | 949 bool allow_natives_; |
948 bool allow_harmony_sloppy_; | 950 bool allow_harmony_sloppy_; |
949 bool allow_harmony_sloppy_function_; | 951 bool allow_harmony_sloppy_function_; |
950 bool allow_harmony_sloppy_let_; | 952 bool allow_harmony_sloppy_let_; |
951 bool allow_harmony_default_parameters_; | 953 bool allow_harmony_default_parameters_; |
952 bool allow_harmony_destructuring_bind_; | 954 bool allow_harmony_destructuring_bind_; |
953 bool allow_harmony_destructuring_assignment_; | 955 bool allow_harmony_destructuring_assignment_; |
| 956 bool allow_harmony_restrictive_declarations_; |
954 bool allow_strong_mode_; | 957 bool allow_strong_mode_; |
955 bool allow_legacy_const_; | 958 bool allow_legacy_const_; |
956 bool allow_harmony_do_expressions_; | 959 bool allow_harmony_do_expressions_; |
957 bool allow_harmony_function_name_; | 960 bool allow_harmony_function_name_; |
958 bool allow_harmony_function_sent_; | 961 bool allow_harmony_function_sent_; |
959 }; | 962 }; |
960 | 963 |
961 template <class Traits> | 964 template <class Traits> |
962 ParserBase<Traits>::FunctionState::FunctionState( | 965 ParserBase<Traits>::FunctionState::FunctionState( |
963 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope, | 966 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope, |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 has_seen_constructor_ = true; | 3372 has_seen_constructor_ = true; |
3370 return; | 3373 return; |
3371 } | 3374 } |
3372 } | 3375 } |
3373 | 3376 |
3374 | 3377 |
3375 } // namespace internal | 3378 } // namespace internal |
3376 } // namespace v8 | 3379 } // namespace v8 |
3377 | 3380 |
3378 #endif // V8_PARSING_PARSER_BASE_H | 3381 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |