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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); } | 100 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); } |
101 bool allow_harmony_numeric_literals() const { | 101 bool allow_harmony_numeric_literals() const { |
102 return scanner()->HarmonyNumericLiterals(); | 102 return scanner()->HarmonyNumericLiterals(); |
103 } | 103 } |
104 bool allow_harmony_classes() const { return scanner()->HarmonyClasses(); } | 104 bool allow_harmony_classes() const { return scanner()->HarmonyClasses(); } |
105 bool allow_harmony_object_literals() const { | 105 bool allow_harmony_object_literals() const { |
106 return allow_harmony_object_literals_; | 106 return allow_harmony_object_literals_; |
107 } | 107 } |
108 bool allow_harmony_templates() const { return scanner()->HarmonyTemplates(); } | 108 bool allow_harmony_templates() const { return scanner()->HarmonyTemplates(); } |
109 bool allow_harmony_sloppy() const { return allow_harmony_sloppy_; } | 109 bool allow_harmony_sloppy() const { return allow_harmony_sloppy_; } |
| 110 bool allow_harmony_unicode() const { return scanner()->HarmonyUnicode(); } |
110 | 111 |
111 // Setters that determine whether certain syntactical constructs are | 112 // Setters that determine whether certain syntactical constructs are |
112 // allowed to be parsed by this instance of the parser. | 113 // allowed to be parsed by this instance of the parser. |
113 void set_allow_lazy(bool allow) { allow_lazy_ = allow; } | 114 void set_allow_lazy(bool allow) { allow_lazy_ = allow; } |
114 void set_allow_natives(bool allow) { allow_natives_ = allow; } | 115 void set_allow_natives(bool allow) { allow_natives_ = allow; } |
115 void set_allow_harmony_arrow_functions(bool allow) { | 116 void set_allow_harmony_arrow_functions(bool allow) { |
116 allow_harmony_arrow_functions_ = allow; | 117 allow_harmony_arrow_functions_ = allow; |
117 } | 118 } |
118 void set_allow_harmony_modules(bool allow) { | 119 void set_allow_harmony_modules(bool allow) { |
119 scanner()->SetHarmonyModules(allow); | 120 scanner()->SetHarmonyModules(allow); |
120 } | 121 } |
121 void set_allow_harmony_scoping(bool allow) { | 122 void set_allow_harmony_scoping(bool allow) { |
122 scanner()->SetHarmonyScoping(allow); | 123 scanner()->SetHarmonyScoping(allow); |
123 } | 124 } |
124 void set_allow_harmony_numeric_literals(bool allow) { | 125 void set_allow_harmony_numeric_literals(bool allow) { |
125 scanner()->SetHarmonyNumericLiterals(allow); | 126 scanner()->SetHarmonyNumericLiterals(allow); |
126 } | 127 } |
127 void set_allow_harmony_classes(bool allow) { | 128 void set_allow_harmony_classes(bool allow) { |
128 scanner()->SetHarmonyClasses(allow); | 129 scanner()->SetHarmonyClasses(allow); |
129 } | 130 } |
130 void set_allow_harmony_object_literals(bool allow) { | 131 void set_allow_harmony_object_literals(bool allow) { |
131 allow_harmony_object_literals_ = allow; | 132 allow_harmony_object_literals_ = allow; |
132 } | 133 } |
133 void set_allow_harmony_templates(bool allow) { | 134 void set_allow_harmony_templates(bool allow) { |
134 scanner()->SetHarmonyTemplates(allow); | 135 scanner()->SetHarmonyTemplates(allow); |
135 } | 136 } |
136 void set_allow_harmony_sloppy(bool allow) { | 137 void set_allow_harmony_sloppy(bool allow) { |
137 allow_harmony_sloppy_ = allow; | 138 allow_harmony_sloppy_ = allow; |
138 } | 139 } |
| 140 void set_allow_harmony_unicode(bool allow) { |
| 141 scanner()->SetHarmonyUnicode(allow); |
| 142 } |
139 | 143 |
140 protected: | 144 protected: |
141 enum AllowEvalOrArgumentsAsIdentifier { | 145 enum AllowEvalOrArgumentsAsIdentifier { |
142 kAllowEvalOrArguments, | 146 kAllowEvalOrArguments, |
143 kDontAllowEvalOrArguments | 147 kDontAllowEvalOrArguments |
144 }; | 148 }; |
145 | 149 |
146 enum Mode { | 150 enum Mode { |
147 PARSE_LAZILY, | 151 PARSE_LAZILY, |
148 PARSE_EAGERLY | 152 PARSE_EAGERLY |
(...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2918 DCHECK(IsAccessorAccessorConflict(old_type, type)); | 2922 DCHECK(IsAccessorAccessorConflict(old_type, type)); |
2919 // Both accessors of the same type. | 2923 // Both accessors of the same type. |
2920 parser()->ReportMessage("accessor_get_set"); | 2924 parser()->ReportMessage("accessor_get_set"); |
2921 } | 2925 } |
2922 *ok = false; | 2926 *ok = false; |
2923 } | 2927 } |
2924 } | 2928 } |
2925 } } // v8::internal | 2929 } } // v8::internal |
2926 | 2930 |
2927 #endif // V8_PREPARSER_H | 2931 #endif // V8_PREPARSER_H |
OLD | NEW |