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_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/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ast_value_factory_(ast_value_factory), | 102 ast_value_factory_(ast_value_factory), |
103 log_(log), | 103 log_(log), |
104 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. | 104 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. |
105 stack_limit_(stack_limit), | 105 stack_limit_(stack_limit), |
106 zone_(zone), | 106 zone_(zone), |
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_arrow_functions_(false), | 111 allow_harmony_arrow_functions_(false), |
| 112 allow_harmony_block_function_(false), |
112 allow_harmony_sloppy_(false), | 113 allow_harmony_sloppy_(false), |
113 allow_harmony_sloppy_let_(false), | 114 allow_harmony_sloppy_let_(false), |
114 allow_harmony_rest_parameters_(false), | 115 allow_harmony_rest_parameters_(false), |
115 allow_harmony_spreadcalls_(false), | 116 allow_harmony_spreadcalls_(false), |
116 allow_harmony_destructuring_(false), | 117 allow_harmony_destructuring_(false), |
117 allow_harmony_spread_arrays_(false), | 118 allow_harmony_spread_arrays_(false), |
118 allow_harmony_new_target_(false), | 119 allow_harmony_new_target_(false), |
119 allow_strong_mode_(false), | 120 allow_strong_mode_(false), |
120 allow_legacy_const_(true) {} | 121 allow_legacy_const_(true) {} |
121 | 122 |
122 #define ALLOW_ACCESSORS(name) \ | 123 #define ALLOW_ACCESSORS(name) \ |
123 bool allow_##name() const { return allow_##name##_; } \ | 124 bool allow_##name() const { return allow_##name##_; } \ |
124 void set_allow_##name(bool allow) { allow_##name##_ = allow; } | 125 void set_allow_##name(bool allow) { allow_##name##_ = allow; } |
125 | 126 |
126 ALLOW_ACCESSORS(lazy); | 127 ALLOW_ACCESSORS(lazy); |
127 ALLOW_ACCESSORS(natives); | 128 ALLOW_ACCESSORS(natives); |
128 ALLOW_ACCESSORS(harmony_arrow_functions); | 129 ALLOW_ACCESSORS(harmony_arrow_functions); |
| 130 ALLOW_ACCESSORS(harmony_block_function); |
129 ALLOW_ACCESSORS(harmony_sloppy); | 131 ALLOW_ACCESSORS(harmony_sloppy); |
130 ALLOW_ACCESSORS(harmony_sloppy_let); | 132 ALLOW_ACCESSORS(harmony_sloppy_let); |
131 ALLOW_ACCESSORS(harmony_rest_parameters); | 133 ALLOW_ACCESSORS(harmony_rest_parameters); |
132 ALLOW_ACCESSORS(harmony_spreadcalls); | 134 ALLOW_ACCESSORS(harmony_spreadcalls); |
133 ALLOW_ACCESSORS(harmony_destructuring); | 135 ALLOW_ACCESSORS(harmony_destructuring); |
134 ALLOW_ACCESSORS(harmony_spread_arrays); | 136 ALLOW_ACCESSORS(harmony_spread_arrays); |
135 ALLOW_ACCESSORS(harmony_new_target); | 137 ALLOW_ACCESSORS(harmony_new_target); |
136 ALLOW_ACCESSORS(strong_mode); | 138 ALLOW_ACCESSORS(strong_mode); |
137 ALLOW_ACCESSORS(legacy_const); | 139 ALLOW_ACCESSORS(legacy_const); |
138 #undef ALLOW_ACCESSORS | 140 #undef ALLOW_ACCESSORS |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 | 794 |
793 private: | 795 private: |
794 Zone* zone_; | 796 Zone* zone_; |
795 | 797 |
796 Scanner* scanner_; | 798 Scanner* scanner_; |
797 bool stack_overflow_; | 799 bool stack_overflow_; |
798 | 800 |
799 bool allow_lazy_; | 801 bool allow_lazy_; |
800 bool allow_natives_; | 802 bool allow_natives_; |
801 bool allow_harmony_arrow_functions_; | 803 bool allow_harmony_arrow_functions_; |
| 804 bool allow_harmony_block_function_; |
802 bool allow_harmony_sloppy_; | 805 bool allow_harmony_sloppy_; |
803 bool allow_harmony_sloppy_let_; | 806 bool allow_harmony_sloppy_let_; |
804 bool allow_harmony_rest_parameters_; | 807 bool allow_harmony_rest_parameters_; |
805 bool allow_harmony_spreadcalls_; | 808 bool allow_harmony_spreadcalls_; |
806 bool allow_harmony_destructuring_; | 809 bool allow_harmony_destructuring_; |
807 bool allow_harmony_spread_arrays_; | 810 bool allow_harmony_spread_arrays_; |
808 bool allow_harmony_new_target_; | 811 bool allow_harmony_new_target_; |
809 bool allow_strong_mode_; | 812 bool allow_strong_mode_; |
810 bool allow_legacy_const_; | 813 bool allow_legacy_const_; |
811 }; | 814 }; |
(...skipping 3210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4022 *ok = false; | 4025 *ok = false; |
4023 return; | 4026 return; |
4024 } | 4027 } |
4025 has_seen_constructor_ = true; | 4028 has_seen_constructor_ = true; |
4026 return; | 4029 return; |
4027 } | 4030 } |
4028 } | 4031 } |
4029 } } // v8::internal | 4032 } } // v8::internal |
4030 | 4033 |
4031 #endif // V8_PREPARSER_H | 4034 #endif // V8_PREPARSER_H |
OLD | NEW |