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.h" | 10 #include "src/zone.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 // Parses and returns a single escaped character. The character | 168 // Parses and returns a single escaped character. The character |
169 // must not be 'b' or 'B' since they are usually handle specially. | 169 // must not be 'b' or 'B' since they are usually handle specially. |
170 uc32 ParseClassCharacterEscape(); | 170 uc32 ParseClassCharacterEscape(); |
171 | 171 |
172 // Checks whether the following is a length-digit hexadecimal number, | 172 // Checks whether the following is a length-digit hexadecimal number, |
173 // and sets the value if it is. | 173 // and sets the value if it is. |
174 bool ParseHexEscape(int length, uc32* value); | 174 bool ParseHexEscape(int length, uc32* value); |
175 bool ParseUnicodeEscape(uc32* value); | 175 bool ParseUnicodeEscape(uc32* value); |
176 bool ParseUnlimitedLengthHexNumber(int max_value, uc32* value); | 176 bool ParseUnlimitedLengthHexNumber(int max_value, uc32* value); |
177 ZoneList<CharacterRange>* ParsePropertyClass(); | 177 bool ParsePropertyClass(ZoneList<CharacterRange>* result); |
178 | 178 |
179 uc32 ParseOctalLiteral(); | 179 uc32 ParseOctalLiteral(); |
180 | 180 |
181 // Tries to parse the input as a back reference. If successful it | 181 // Tries to parse the input as a back reference. If successful it |
182 // stores the result in the output parameter and returns true. If | 182 // stores the result in the output parameter and returns true. If |
183 // it fails it will push back the characters read so the same characters | 183 // it fails it will push back the characters read so the same characters |
184 // can be reparsed. | 184 // can be reparsed. |
185 bool ParseBackReferenceIndex(int* index_out); | 185 bool ParseBackReferenceIndex(int* index_out); |
186 | 186 |
| 187 bool ParseClassProperty(ZoneList<CharacterRange>* result); |
187 CharacterRange ParseClassAtom(uc16* char_class); | 188 CharacterRange ParseClassAtom(uc16* char_class); |
188 RegExpTree* ReportError(Vector<const char> message); | 189 RegExpTree* ReportError(Vector<const char> message); |
189 void Advance(); | 190 void Advance(); |
190 void Advance(int dist); | 191 void Advance(int dist); |
191 void Reset(int pos); | 192 void Reset(int pos); |
192 | 193 |
193 // 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. |
194 // 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. |
195 bool simple(); | 196 bool simple(); |
196 bool contains_anchor() { return contains_anchor_; } | 197 bool contains_anchor() { return contains_anchor_; } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 bool simple_; | 291 bool simple_; |
291 bool contains_anchor_; | 292 bool contains_anchor_; |
292 bool is_scanned_for_captures_; | 293 bool is_scanned_for_captures_; |
293 bool failed_; | 294 bool failed_; |
294 }; | 295 }; |
295 | 296 |
296 } // namespace internal | 297 } // namespace internal |
297 } // namespace v8 | 298 } // namespace v8 |
298 | 299 |
299 #endif // V8_REGEXP_REGEXP_PARSER_H_ | 300 #endif // V8_REGEXP_REGEXP_PARSER_H_ |
OLD | NEW |