OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_REGEXP_REGEXP_PARSER_H_ | 5 #ifndef V8_REGEXP_REGEXP_PARSER_H_ |
6 #define V8_REGEXP_REGEXP_PARSER_H_ | 6 #define V8_REGEXP_REGEXP_PARSER_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 #include "src/regexp/regexp-ast.h" | 9 #include "src/regexp/regexp-ast.h" |
10 #include "src/zone/zone.h" | 10 #include "src/zone/zone.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 void Reset(int pos); | 192 void Reset(int pos); |
193 | 193 |
194 // Reports whether the pattern might be used as a literal search string. | 194 // Reports whether the pattern might be used as a literal search string. |
195 // Only use if the result of the parse is a single atom node. | 195 // Only use if the result of the parse is a single atom node. |
196 bool simple(); | 196 bool simple(); |
197 bool contains_anchor() { return contains_anchor_; } | 197 bool contains_anchor() { return contains_anchor_; } |
198 void set_contains_anchor() { contains_anchor_ = true; } | 198 void set_contains_anchor() { contains_anchor_ = true; } |
199 int captures_started() { return captures_started_; } | 199 int captures_started() { return captures_started_; } |
200 int position() { return next_pos_ - 1; } | 200 int position() { return next_pos_ - 1; } |
201 bool failed() { return failed_; } | 201 bool failed() { return failed_; } |
| 202 bool dotall() const { return dotall_; } |
202 bool ignore_case() const { return ignore_case_; } | 203 bool ignore_case() const { return ignore_case_; } |
203 bool multiline() const { return multiline_; } | 204 bool multiline() const { return multiline_; } |
204 bool unicode() const { return unicode_; } | 205 bool unicode() const { return unicode_; } |
205 | 206 |
206 static bool IsSyntaxCharacterOrSlash(uc32 c); | 207 static bool IsSyntaxCharacterOrSlash(uc32 c); |
207 | 208 |
208 static const int kMaxCaptures = 1 << 16; | 209 static const int kMaxCaptures = 1 << 16; |
209 static const uc32 kEndMarker = (1 << 21); | 210 static const uc32 kEndMarker = (1 << 21); |
210 | 211 |
211 private: | 212 private: |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void ScanForCaptures(); | 306 void ScanForCaptures(); |
306 | 307 |
307 Isolate* isolate_; | 308 Isolate* isolate_; |
308 Zone* zone_; | 309 Zone* zone_; |
309 Handle<String>* error_; | 310 Handle<String>* error_; |
310 ZoneList<RegExpCapture*>* captures_; | 311 ZoneList<RegExpCapture*>* captures_; |
311 ZoneList<RegExpCapture*>* named_captures_; | 312 ZoneList<RegExpCapture*>* named_captures_; |
312 ZoneList<RegExpBackReference*>* named_back_references_; | 313 ZoneList<RegExpBackReference*>* named_back_references_; |
313 FlatStringReader* in_; | 314 FlatStringReader* in_; |
314 uc32 current_; | 315 uc32 current_; |
| 316 bool dotall_; |
315 bool ignore_case_; | 317 bool ignore_case_; |
316 bool multiline_; | 318 bool multiline_; |
317 bool unicode_; | 319 bool unicode_; |
318 int next_pos_; | 320 int next_pos_; |
319 int captures_started_; | 321 int captures_started_; |
320 // The capture count is only valid after we have scanned for captures. | 322 // The capture count is only valid after we have scanned for captures. |
321 int capture_count_; | 323 int capture_count_; |
322 bool has_more_; | 324 bool has_more_; |
323 bool simple_; | 325 bool simple_; |
324 bool contains_anchor_; | 326 bool contains_anchor_; |
325 bool is_scanned_for_captures_; | 327 bool is_scanned_for_captures_; |
326 bool failed_; | 328 bool failed_; |
327 }; | 329 }; |
328 | 330 |
329 } // namespace internal | 331 } // namespace internal |
330 } // namespace v8 | 332 } // namespace v8 |
331 | 333 |
332 #endif // V8_REGEXP_REGEXP_PARSER_H_ | 334 #endif // V8_REGEXP_REGEXP_PARSER_H_ |
OLD | NEW |