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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 fni_(NULL), | 101 fni_(NULL), |
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_tailcalls_(false), |
111 allow_harmony_sloppy_(false), | 112 allow_harmony_sloppy_(false), |
112 allow_harmony_sloppy_function_(false), | 113 allow_harmony_sloppy_function_(false), |
113 allow_harmony_sloppy_let_(false), | 114 allow_harmony_sloppy_let_(false), |
114 allow_harmony_restrictive_declarations_(false), | 115 allow_harmony_restrictive_declarations_(false), |
115 allow_legacy_const_(true), | 116 allow_legacy_const_(true), |
116 allow_harmony_do_expressions_(false), | 117 allow_harmony_do_expressions_(false), |
117 allow_harmony_function_name_(false), | 118 allow_harmony_function_name_(false), |
118 allow_harmony_function_sent_(false) {} | 119 allow_harmony_function_sent_(false) {} |
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 #define SCANNER_ACCESSORS(name) \ | 125 #define SCANNER_ACCESSORS(name) \ |
125 bool allow_##name() const { return scanner_->allow_##name(); } \ | 126 bool allow_##name() const { return scanner_->allow_##name(); } \ |
126 void set_allow_##name(bool allow) { \ | 127 void set_allow_##name(bool allow) { \ |
127 return scanner_->set_allow_##name(allow); \ | 128 return scanner_->set_allow_##name(allow); \ |
128 } | 129 } |
129 | 130 |
130 ALLOW_ACCESSORS(lazy); | 131 ALLOW_ACCESSORS(lazy); |
131 ALLOW_ACCESSORS(natives); | 132 ALLOW_ACCESSORS(natives); |
| 133 ALLOW_ACCESSORS(tailcalls); |
132 ALLOW_ACCESSORS(harmony_sloppy); | 134 ALLOW_ACCESSORS(harmony_sloppy); |
133 ALLOW_ACCESSORS(harmony_sloppy_function); | 135 ALLOW_ACCESSORS(harmony_sloppy_function); |
134 ALLOW_ACCESSORS(harmony_sloppy_let); | 136 ALLOW_ACCESSORS(harmony_sloppy_let); |
135 ALLOW_ACCESSORS(harmony_restrictive_declarations); | 137 ALLOW_ACCESSORS(harmony_restrictive_declarations); |
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 SCANNER_ACCESSORS(harmony_exponentiation_operator); | 142 SCANNER_ACCESSORS(harmony_exponentiation_operator); |
141 #undef ALLOW_ACCESSORS | 143 #undef ALLOW_ACCESSORS |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 uintptr_t stack_limit_; | 913 uintptr_t stack_limit_; |
912 | 914 |
913 private: | 915 private: |
914 Zone* zone_; | 916 Zone* zone_; |
915 | 917 |
916 Scanner* scanner_; | 918 Scanner* scanner_; |
917 bool stack_overflow_; | 919 bool stack_overflow_; |
918 | 920 |
919 bool allow_lazy_; | 921 bool allow_lazy_; |
920 bool allow_natives_; | 922 bool allow_natives_; |
| 923 bool allow_tailcalls_; |
921 bool allow_harmony_sloppy_; | 924 bool allow_harmony_sloppy_; |
922 bool allow_harmony_sloppy_function_; | 925 bool allow_harmony_sloppy_function_; |
923 bool allow_harmony_sloppy_let_; | 926 bool allow_harmony_sloppy_let_; |
924 bool allow_harmony_restrictive_declarations_; | 927 bool allow_harmony_restrictive_declarations_; |
925 bool allow_legacy_const_; | 928 bool allow_legacy_const_; |
926 bool allow_harmony_do_expressions_; | 929 bool allow_harmony_do_expressions_; |
927 bool allow_harmony_function_name_; | 930 bool allow_harmony_function_name_; |
928 bool allow_harmony_function_sent_; | 931 bool allow_harmony_function_sent_; |
929 }; | 932 }; |
930 | 933 |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3111 has_seen_constructor_ = true; | 3114 has_seen_constructor_ = true; |
3112 return; | 3115 return; |
3113 } | 3116 } |
3114 } | 3117 } |
3115 | 3118 |
3116 | 3119 |
3117 } // namespace internal | 3120 } // namespace internal |
3118 } // namespace v8 | 3121 } // namespace v8 |
3119 | 3122 |
3120 #endif // V8_PARSING_PARSER_BASE_H | 3123 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |