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