7#include "unicode/uchar.h"
8#include "unicode/uniset.h"
24 : zone_(
Thread::Current()->zone()),
25 pending_empty_(
false),
28 pending_surrogate_(kNoPendingSurrogate),
39void RegExpBuilder::AddLeadSurrogate(uint16_t lead_surrogate) {
41 FlushPendingSurrogate();
43 pending_surrogate_ = lead_surrogate;
46void RegExpBuilder::AddTrailSurrogate(uint16_t trail_surrogate) {
48 if (pending_surrogate_ != kNoPendingSurrogate) {
49 uint16_t lead_surrogate = pending_surrogate_;
50 pending_surrogate_ = kNoPendingSurrogate;
52 uint32_t combined =
Utf16::Decode(lead_surrogate, trail_surrogate);
53 if (NeedsDesugaringForIgnoreCase(combined)) {
56 auto surrogate_pair =
new (
Z) ZoneGrowableArray<uint16_t>(2);
57 surrogate_pair->Add(lead_surrogate);
58 surrogate_pair->Add(trail_surrogate);
59 RegExpAtom* atom =
new (
Z) RegExpAtom(surrogate_pair, flags_);
63 pending_surrogate_ = trail_surrogate;
64 FlushPendingSurrogate();
68void RegExpBuilder::FlushPendingSurrogate() {
69 if (pending_surrogate_ != kNoPendingSurrogate) {
71 uint32_t c = pending_surrogate_;
72 pending_surrogate_ = kNoPendingSurrogate;
77void RegExpBuilder::FlushCharacters() {
78 FlushPendingSurrogate();
79 pending_empty_ =
false;
80 if (characters_ !=
nullptr) {
81 RegExpTree* atom =
new (
Z) RegExpAtom(characters_, flags_);
82 characters_ =
nullptr;
88void RegExpBuilder::FlushText() {
90 intptr_t num_text = text_.length();
93 }
else if (num_text == 1) {
94 terms_.Add(text_.Last());
96 RegExpText*
text =
new (
Z) RegExpText();
97 for (intptr_t
i = 0;
i < num_text;
i++)
98 text_[
i]->AppendToText(
text);
105 FlushPendingSurrogate();
106 pending_empty_ =
false;
107 if (NeedsDesugaringForIgnoreCase(c)) {
110 if (characters_ ==
nullptr) {
121 uint16_t surrogates[2];
123 AddLeadSurrogate(surrogates[0]);
124 AddTrailSurrogate(surrogates[1]);
128 AddTrailSurrogate(c);
137 FlushPendingSurrogate();
139 FlushPendingSurrogate();
143 pending_empty_ =
true;
147 if (NeedsDesugaringForUnicode(
cc)) {
162 if (term->IsEmpty()) {
192void RegExpBuilder::FlushTerms() {
194 intptr_t num_terms = terms_.length();
196 if (num_terms == 0) {
198 }
else if (num_terms == 1) {
199 alternative = terms_.Last();
201 ZoneGrowableArray<RegExpTree*>* terms =
202 new (
Z) ZoneGrowableArray<RegExpTree*>();
203 for (intptr_t
i = 0;
i < terms_.length();
i++) {
204 terms->Add(terms_[
i]);
206 alternative =
new (
Z) RegExpAlternative(terms);
208 alternatives_.Add(alternative);
213bool RegExpBuilder::NeedsDesugaringForUnicode(RegExpCharacterClass*
cc) {
214 if (!is_unicode())
return false;
219 ZoneGrowableArray<CharacterRange>* ranges =
cc->ranges();
222 if (
cc->is_negated()) {
223 auto negated_ranges =
224 new (
Z) ZoneGrowableArray<CharacterRange>(ranges->length());
226 ranges = negated_ranges;
229 for (
int i = ranges->length() - 1;
i >= 0;
i--) {
230 uint32_t from = ranges->At(
i).from();
231 uint32_t to = ranges->At(
i).to();
242bool RegExpBuilder::NeedsDesugaringForIgnoreCase(uint32_t c) {
244 icu::UnicodeSet
set(c, c);
245 set.closeOver(USET_CASE_INSENSITIVE);
246 set.removeAllStrings();
247 return set.size() > 1;
254 intptr_t num_alternatives = alternatives_.length();
255 if (num_alternatives == 0) {
258 if (num_alternatives == 1) {
259 return alternatives_.Last();
263 for (intptr_t
i = 0;
i < alternatives_.length();
i++) {
264 alternatives->
Add(alternatives_[
i]);
273 if (pending_empty_) {
274 pending_empty_ =
false;
278 if (characters_ !=
nullptr) {
284 char_vector->
AddArray(*characters_);
285 intptr_t num_chars = char_vector->
length();
289 for (intptr_t
i = 0;
i < num_chars - 1;
i++) {
294 tail->Add(char_vector->
At(num_chars - 1));
297 characters_ =
nullptr;
300 }
else if (text_.length() > 0) {
302 atom = text_.RemoveLast();
304 }
else if (terms_.length() > 0) {
306 atom = terms_.RemoveLast();
307 if (
auto lookaround = atom->AsLookaround()) {
309 if (is_unicode())
return false;
337 : zone_(
Thread::Current()->zone()),
339 named_captures_(nullptr),
340 named_back_references_(nullptr),
342 current_(kEndMarker),
344 captures_started_(0),
347 top_level_flags_(
flags),
349 contains_anchor_(
false),
350 is_scanned_for_captures_(
false),
351 has_named_captures_(
false) {
355inline uint32_t RegExpParser::ReadNext(
bool update_position) {
367 if (update_position) next_pos_ =
position;
371uint32_t RegExpParser::Next() {
373 return ReadNext(
false);
381 current_ = ReadNext(
true);
386 next_pos_ = in().
Length() + 1;
398 next_pos_ += dist - 1;
433 next_pos_ = in().
Length();
454 PatchNamedBackReferences();
458 if (
result->IsAtom() &&
result->AsAtom()->length() == in().Length()) {
467 "Invalid identity escape in Unicode pattern";
482 0,
nullptr, top_level_flags_,
Z);
483 RegExpParserState* stored_state = &initial_state;
489 if (stored_state->IsSubexpression()) {
494 ASSERT(INITIAL == stored_state->group_type());
498 if (!stored_state->IsSubexpression()) {
502 ASSERT(INITIAL != stored_state->group_type());
511 intptr_t capture_index = stored_state->capture_index();
512 SubexpressionType group_type = stored_state->group_type();
515 if (group_type == CAPTURE) {
516 if (stored_state->IsNamedCapture()) {
517 CreateNamedCaptureAtIndex(stored_state->capture_name(),
523 }
else if (group_type != GROUPING) {
524 ASSERT(group_type == POSITIVE_LOOKAROUND ||
525 group_type == NEGATIVE_LOOKAROUND);
526 bool is_positive = (group_type == POSITIVE_LOOKAROUND);
528 body, is_positive, end_capture_index - capture_index,
529 capture_index, stored_state->lookaround_type());
533 stored_state = stored_state->previous_state();
534 builder = stored_state->builder();
553 if (
builder->is_multi_line()) {
592 stored_state = ParseOpenParenthesis(stored_state);
593 builder = stored_state->builder();
598 builder->AddCharacterClass(atom->AsCharacterClass());
674 if (stored_state->IsInsideCaptureGroup(index)) {
695 uint32_t first_digit = Next();
696 if (first_digit ==
'8' || first_digit ==
'9') {
697 builder->AddCharacter(first_digit);
705 if (
is_unicode() && Next() >=
'0' && Next() <=
'9') {
738 uint32_t controlLetter = Next();
741 uint32_t letter = controlLetter & ~(
'a' ^
'A');
742 if (letter <
'A' ||
'Z' < letter) {
755 builder->AddCharacter(controlLetter & 0x1f);
795 ParseNamedBackReference(
builder, stored_state);
805 builder->AddCharacter(current());
830 builder->AddUnicodeCharacter(current());
861 ReportError(
"numbers out of order in {} quantifier.");
872 if (current() ==
'?') {
880 if (!
builder->AddQuantifierToAtom(
min,
max, quantifier_type)) {
889static bool IsSpecialClassEscape(uint32_t c) {
904RegExpParser::RegExpParserState* RegExpParser::ParseOpenParenthesis(
905 RegExpParserState*
state) {
907 bool is_named_capture =
false;
909 SubexpressionType subexpr_type = CAPTURE;
911 if (current() ==
'?') {
915 subexpr_type = GROUPING;
920 subexpr_type = POSITIVE_LOOKAROUND;
925 subexpr_type = NEGATIVE_LOOKAROUND;
932 subexpr_type = POSITIVE_LOOKAROUND;
934 }
else if (Next() ==
'!') {
937 subexpr_type = NEGATIVE_LOOKAROUND;
940 is_named_capture =
true;
941 has_named_captures_ =
true;
950 if (subexpr_type == CAPTURE) {
957 if (is_named_capture) {
958 capture_name = ParseCaptureGroupName();
963 RegExpParserState(
state, subexpr_type, lookaround_type, captures_started_,
964 capture_name,
state->builder()->flags(),
Z);
973void RegExpParser::ScanForCaptures() {
974 ASSERT(!is_scanned_for_captures_);
975 const intptr_t saved_position =
position();
1005 if (current() ==
'?') {
1007 if (current() !=
'<')
break;
1010 if (current() ==
'=' || current() ==
'!')
break;
1015 has_named_captures_ =
true;
1021 capture_count_ = capture_count;
1022 is_scanned_for_captures_ =
true;
1023 Reset(saved_position);
1027 ASSERT(
'\\' == current());
1028 ASSERT(
'1' <= Next() && Next() <=
'9');
1032 intptr_t
value = Next() -
'0';
1035 uint32_t c = current();
1048 if (!is_scanned_for_captures_) ScanForCaptures();
1049 if (
value > capture_count_) {
1060static inline constexpr bool IsAsciiIdentifierPart(uint32_t ch) {
1066static bool IsIdentifierStartSlow(uint32_t c) {
1069 return u_hasBinaryProperty(c, UCHAR_ID_START) ||
1070 (c < 0x60 && (c ==
'$' || c ==
'\\' || c ==
'_'));
1075static bool IsIdentifierPartSlow(uint32_t c) {
1076 const uint32_t kZeroWidthNonJoiner = 0x200C;
1077 const uint32_t kZeroWidthJoiner = 0x200D;
1080 return u_hasBinaryProperty(c, UCHAR_ID_CONTINUE) ||
1081 (c < 0x60 && (c ==
'$' || c ==
'\\' || c ==
'_')) ||
1082 c == kZeroWidthNonJoiner || c == kZeroWidthJoiner;
1085static inline bool IsIdentifierStart(uint32_t c) {
1086 if (c > 127)
return IsIdentifierStartSlow(c);
1090static inline bool IsIdentifierPart(uint32_t c) {
1091 if (c > 127)
return IsIdentifierPartSlow(c);
1092 return IsAsciiIdentifierPart(c);
1097 if (name1->length() != name2->length())
return false;
1098 for (intptr_t
i = 0;
i < name1->length();
i++) {
1099 if (name1->At(
i) != name2->At(
i))
return false;
1120 bool at_start =
true;
1122 uint32_t c = current();
1126 if (c ==
'\\' && current() ==
'u') {
1141 if (!IsIdentifierStart(c)) {
1150 }
else if (IsIdentifierPart(c)) {
1163 for (
const auto& capture : *named_captures_) {
1164 if (IsSameName(
name, capture->name()))
return capture->index();
1171 ASSERT(0 < index && index <= captures_started_);
1174 if (named_captures_ ==
nullptr) {
1175 named_captures_ =
new (
Z) ZoneGrowableArray<RegExpCapture*>(1);
1178 if (GetNamedCaptureIndex(
name) >= 0) {
1184 RegExpCapture* capture = GetCapture(index);
1185 ASSERT(capture->name() ==
nullptr);
1187 capture->set_name(
name);
1188 named_captures_->Add(capture);
1191bool RegExpParser::ParseNamedBackReference(RegExpBuilder*
builder,
1192 RegExpParserState*
state) {
1194 if (current() !=
'<') {
1201 if (
name ==
nullptr) {
1205 if (
state->IsInsideCaptureGroup(
name)) {
1208 RegExpBackReference* atom =
new (
Z) RegExpBackReference(
builder->flags());
1209 atom->set_name(
name);
1213 if (named_back_references_ ==
nullptr) {
1214 named_back_references_ =
1215 new (
Z) ZoneGrowableArray<RegExpBackReference*>(1);
1217 named_back_references_->Add(atom);
1223void RegExpParser::PatchNamedBackReferences() {
1224 if (named_back_references_ ==
nullptr)
return;
1226 if (named_captures_ ==
nullptr) {
1233 for (intptr_t
i = 0;
i < named_back_references_->length();
i++) {
1234 RegExpBackReference* ref = named_back_references_->At(
i);
1235 intptr_t index = GetNamedCaptureIndex(ref->name());
1241 ref->set_capture(GetCapture(index));
1245RegExpCapture* RegExpParser::GetCapture(intptr_t index) {
1248 const intptr_t know_captures =
1249 is_scanned_for_captures_ ? capture_count_ : captures_started_;
1250 ASSERT(index <= know_captures);
1251 if (captures_ ==
nullptr) {
1252 captures_ =
new (
Z) ZoneGrowableArray<RegExpCapture*>(know_captures);
1254 while (captures_->length() < know_captures) {
1255 captures_->Add(
new (
Z) RegExpCapture(captures_->length() + 1));
1257 return captures_->At(index - 1);
1260ArrayPtr RegExpParser::CreateCaptureNameMap() {
1261 if (named_captures_ ==
nullptr || named_captures_->is_empty()) {
1265 const intptr_t
len = named_captures_->length() * 2;
1271 for (intptr_t
i = 0;
i < named_captures_->length();
i++) {
1272 RegExpCapture* capture = named_captures_->At(
i);
1276 array.SetAt(
i * 2,
name);
1277 array.SetAt(
i * 2 + 1, smi);
1283bool RegExpParser::HasNamedCaptures() {
1284 if (has_named_captures_ || is_scanned_for_captures_) {
1285 return has_named_captures_;
1289 ASSERT(is_scanned_for_captures_);
1290 return has_named_captures_;
1293bool RegExpParser::RegExpParserState::IsInsideCaptureGroup(intptr_t index) {
1294 for (RegExpParserState*
s =
this;
s !=
nullptr;
s =
s->previous_state()) {
1295 if (
s->group_type() != CAPTURE)
continue;
1297 if (index ==
s->capture_index())
return true;
1299 if (index >
s->capture_index())
return false;
1304bool RegExpParser::RegExpParserState::IsInsideCaptureGroup(
1307 for (RegExpParserState*
s =
this;
s !=
nullptr;
s =
s->previous_state()) {
1308 if (
s->capture_name() ==
nullptr)
continue;
1309 if (IsSameName(
s->capture_name(),
name))
return true;
1322 intptr_t* max_out) {
1323 ASSERT(current() ==
'{');
1332 intptr_t
next = current() -
'0';
1345 if (current() ==
'}') {
1348 }
else if (current() ==
',') {
1350 if (current() ==
'}') {
1355 intptr_t
next = current() -
'0';
1366 if (current() !=
'}') {
1385 uint32_t
value = current() -
'0';
1387 if (
'0' <= current() && current() <=
'7') {
1390 if (
value < 32 &&
'0' <= current() && current() <=
'7') {
1402 if (
static_cast<unsigned>(c) <= 9)
return c;
1403 c = (c | 0x20) - (
'a' -
'0');
1404 if (
static_cast<unsigned>(c) <= 5)
return c + 10;
1412 for (intptr_t
i = 0; !
done;
i++) {
1413 uint32_t c = current();
1438 if (current() ==
'}') {
1449 current() ==
'\\') {
1452 if (Next() ==
'u') {
1457 static_cast<uint16_t
>(trail));
1468bool IsExactPropertyAlias(
const char* property_name, UProperty property) {
1469 const char* short_name = u_getPropertyName(property, U_SHORT_PROPERTY_NAME);
1470 if (short_name !=
nullptr && strcmp(property_name, short_name) == 0) {
1473 for (
int i = 0;;
i++) {
1474 const char* long_name = u_getPropertyName(
1475 property,
static_cast<UPropertyNameChoice
>(U_LONG_PROPERTY_NAME +
i));
1476 if (long_name ==
nullptr)
break;
1477 if (strcmp(property_name, long_name) == 0)
return true;
1482bool IsExactPropertyValueAlias(
const char* property_value_name,
1484 int32_t property_value) {
1485 const char* short_name =
1486 u_getPropertyValueName(property, property_value, U_SHORT_PROPERTY_NAME);
1487 if (short_name !=
nullptr && strcmp(property_value_name, short_name) == 0) {
1490 for (
int i = 0;;
i++) {
1491 const char* long_name = u_getPropertyValueName(
1492 property, property_value,
1493 static_cast<UPropertyNameChoice
>(U_LONG_PROPERTY_NAME +
i));
1494 if (long_name ==
nullptr)
break;
1495 if (strcmp(property_value_name, long_name) == 0)
return true;
1500bool LookupPropertyValueName(UProperty property,
1501 const char* property_value_name,
1503 ZoneGrowableArray<CharacterRange>*
result) {
1504 UProperty property_for_lookup = property;
1505 if (property_for_lookup == UCHAR_SCRIPT_EXTENSIONS) {
1508 property_for_lookup = UCHAR_SCRIPT;
1510 int32_t property_value =
1511 u_getPropertyValueEnum(property_for_lookup, property_value_name);
1512 if (property_value == UCHAR_INVALID_CODE)
return false;
1516 if (!IsExactPropertyValueAlias(property_value_name, property_for_lookup,
1521 UErrorCode ec = U_ZERO_ERROR;
1522 icu::UnicodeSet
set;
1523 set.applyIntPropertyValue(property, property_value, ec);
1524 bool success = ec == U_ZERO_ERROR && (
set.isEmpty() == 0);
1527 set.removeAllStrings();
1528 if (negate)
set.complement();
1529 for (
int i = 0;
i <
set.getRangeCount();
i++) {
1538inline bool NameEquals(
const char*
name,
const char (&literal)[
N]) {
1539 return strncmp(
name, literal,
N + 1) == 0;
1542bool LookupSpecialPropertyValueName(
const char*
name,
1543 ZoneGrowableArray<CharacterRange>*
result,
1545 if (NameEquals(
name,
"Any")) {
1552 }
else if (NameEquals(
name,
"ASCII")) {
1555 }
else if (NameEquals(
name,
"Assigned")) {
1556 return LookupPropertyValueName(UCHAR_GENERAL_CATEGORY,
"Unassigned",
1566bool IsSupportedBinaryProperty(UProperty property) {
1568 case UCHAR_ALPHABETIC:
1571 case UCHAR_ASCII_HEX_DIGIT:
1573 case UCHAR_BIDI_CONTROL:
1574 case UCHAR_BIDI_MIRRORED:
1575 case UCHAR_CASE_IGNORABLE:
1577 case UCHAR_CHANGES_WHEN_CASEFOLDED:
1578 case UCHAR_CHANGES_WHEN_CASEMAPPED:
1579 case UCHAR_CHANGES_WHEN_LOWERCASED:
1580 case UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED:
1581 case UCHAR_CHANGES_WHEN_TITLECASED:
1582 case UCHAR_CHANGES_WHEN_UPPERCASED:
1584 case UCHAR_DEFAULT_IGNORABLE_CODE_POINT:
1585 case UCHAR_DEPRECATED:
1586 case UCHAR_DIACRITIC:
1588 case UCHAR_EMOJI_COMPONENT:
1589 case UCHAR_EMOJI_MODIFIER_BASE:
1590 case UCHAR_EMOJI_MODIFIER:
1591 case UCHAR_EMOJI_PRESENTATION:
1592 case UCHAR_EXTENDED_PICTOGRAPHIC:
1593 case UCHAR_EXTENDER:
1594 case UCHAR_GRAPHEME_BASE:
1595 case UCHAR_GRAPHEME_EXTEND:
1596 case UCHAR_HEX_DIGIT:
1597 case UCHAR_ID_CONTINUE:
1598 case UCHAR_ID_START:
1599 case UCHAR_IDEOGRAPHIC:
1600 case UCHAR_IDS_BINARY_OPERATOR:
1601 case UCHAR_IDS_TRINARY_OPERATOR:
1602 case UCHAR_JOIN_CONTROL:
1603 case UCHAR_LOGICAL_ORDER_EXCEPTION:
1604 case UCHAR_LOWERCASE:
1606 case UCHAR_NONCHARACTER_CODE_POINT:
1607 case UCHAR_PATTERN_SYNTAX:
1608 case UCHAR_PATTERN_WHITE_SPACE:
1609 case UCHAR_QUOTATION_MARK:
1611 case UCHAR_REGIONAL_INDICATOR:
1613 case UCHAR_SOFT_DOTTED:
1614 case UCHAR_TERMINAL_PUNCTUATION:
1615 case UCHAR_UNIFIED_IDEOGRAPH:
1616 case UCHAR_UPPERCASE:
1617 case UCHAR_VARIATION_SELECTOR:
1618 case UCHAR_WHITE_SPACE:
1619 case UCHAR_XID_CONTINUE:
1620 case UCHAR_XID_START:
1628bool IsUnicodePropertyValueCharacter(
char c) {
1653 if (current() ==
'{') {
1655 for (
Advance(); current() !=
'}' && current() !=
'=';
Advance()) {
1656 if (!IsUnicodePropertyValueCharacter(current()))
return false;
1657 if (!has_next())
return false;
1658 name_1->
Add(
static_cast<char>(current()));
1660 if (current() ==
'=') {
1662 if (!IsUnicodePropertyValueCharacter(current()))
return false;
1663 if (!has_next())
return false;
1664 name_2->
Add(
static_cast<char>(current()));
1674 ASSERT(
static_cast<size_t>(name_1->
length() - 1) == strlen(name_1->
data()));
1676 static_cast<size_t>(name_2->
length() - 1) == strlen(name_2->
data()));
1690 if (LookupPropertyValueName(UCHAR_GENERAL_CATEGORY_MASK,
name, negate,
1695 if (LookupSpecialPropertyValueName(
name, add_to, negate)) {
1699 UProperty
property = u_getPropertyEnum(
name);
1700 if (!IsSupportedBinaryProperty(property))
return false;
1701 if (!IsExactPropertyAlias(
name, property))
return false;
1702 return LookupPropertyValueName(property, negate ?
"N" :
"Y",
false, add_to);
1706 const char* property_name = name_1->
data();
1707 const char* value_name = name_2->
data();
1708 UProperty
property = u_getPropertyEnum(property_name);
1709 if (!IsExactPropertyAlias(property_name, property))
return false;
1710 if (property == UCHAR_GENERAL_CATEGORY) {
1712 property = UCHAR_GENERAL_CATEGORY_MASK;
1713 }
else if (property != UCHAR_SCRIPT &&
1714 property != UCHAR_SCRIPT_EXTENSIONS) {
1717 return LookupPropertyValueName(property, value_name, negate, add_to);
1730 if (
x > max_value) {
1741 ASSERT(current() ==
'\\');
1742 DEBUG_ASSERT(has_next() && !IsSpecialClassEscape(Next()));
1744 switch (current()) {
1766 uint32_t controlLetter = Next();
1767 uint32_t letter = controlLetter & ~(
'A' ^
'a');
1770 if (letter >=
'A' && letter <=
'Z') {
1774 return controlLetter & 0x1f;
1783 return controlLetter & 0x1f;
1791 if (
is_unicode() && !(Next() >=
'0' && Next() <=
'9')) {
1846 uint32_t
result = current();
1859 bool add_unicode_case_equivalents,
1860 uint32_t* char_out) {
1861 uint32_t first = current();
1862 if (first ==
'\\') {
1871 add_unicode_case_equivalents);
1878 bool negate = Next() ==
'P';
1884 ReportError(
"Invalid property name in character class");
1904 static const char* kUnterminated =
"Unterminated character class";
1905 static const char* kRangeInvalid =
"Invalid character class";
1906 static const char* kRangeOutOfOrder =
"Range out of order in character class";
1908 ASSERT(current() ==
'[');
1910 bool is_negated =
false;
1911 if (current() ==
'^') {
1918 while (has_more() && current() !=
']') {
1919 uint32_t char_1 = 0;
1922 if (current() ==
'-') {
1928 }
else if (current() ==
']') {
1933 uint32_t char_2 = 0;
1936 if (is_class_1 || is_class_2) {
1948 if (char_1 > char_2) {
1982 intptr_t capture_count =
parser.captures_started();
1983 result->simple = tree->IsAtom() &&
parser.simple() && capture_count == 0;
1985 result->capture_name_map =
parser.CreateCaptureNameMap();
1986 result->capture_count = capture_count;
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
static float next(float f)
#define DEBUG_ASSERT(cond)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
void AddArray(const BaseGrowableArray< T, B, Allocator > &src)
const T & At(intptr_t index) const
static void AddClassEscape(uint16_t type, ZoneGrowableArray< CharacterRange > *ranges)
static CharacterRange Range(int32_t from, int32_t to)
static CharacterRange Everything()
static CharacterRange Singleton(int32_t value)
static void Canonicalize(ZoneGrowableArray< CharacterRange > *ranges)
static void Negate(ZoneGrowableArray< CharacterRange > *src, ZoneGrowableArray< CharacterRange > *dst)
static ZoneGrowableArray< CharacterRange > * List(Zone *zone, CharacterRange range)
static DART_NORETURN void ThrowByType(ExceptionType type, const Array &arguments)
void AddAssertion(RegExpTree *tree)
void AddCharacterClass(RegExpCharacterClass *cc)
bool AddQuantifierToAtom(intptr_t min, intptr_t max, RegExpQuantifier::QuantifierType type)
void AddCharacterClassForDesugaring(uint32_t c)
void AddTerm(RegExpTree *tree)
RegExpBuilder(RegExpFlags flags)
void AddEscapedUnicodeCharacter(uint32_t character)
void AddUnicodeCharacter(uint32_t character)
void AddAtom(RegExpTree *tree)
void AddCharacter(uint16_t character)
void set_body(RegExpTree *body)
intptr_t CharacterClassFlags
static CharacterClassFlags DefaultFlags()
static RegExpEmpty * GetInstance()
uint32_t ParseOctalLiteral()
void ReportError(const char *message)
RegExpTree * ParseDisjunction()
RegExpParser(const String &in, String *error, RegExpFlags regexp_flags)
bool ParseClassEscape(ZoneGrowableArray< CharacterRange > *ranges, bool add_unicode_case_equivalents, uint32_t *char_out)
RegExpTree * ParsePattern()
void set_contains_anchor()
bool ParseUnlimitedLengthHexNumber(uint32_t max_value, uint32_t *value)
bool ParseHexEscape(intptr_t length, uint32_t *value)
uint32_t ParseClassCharacterEscape()
bool ParseIntervalQuantifier(intptr_t *min_out, intptr_t *max_out)
static bool IsSyntaxCharacterOrSlash(uint32_t c)
bool AddPropertyClassRange(ZoneGrowableArray< CharacterRange > *add_to, bool negate, ZoneGrowableArray< char > *name_1, ZoneGrowableArray< char > *name_2)
static constexpr uint32_t kEndMarker
bool ParseUnicodeEscape(uint32_t *value)
bool ParseBackReferenceIndex(intptr_t *index_out)
RegExpTree * ParseCharacterClass(const RegExpBuilder *builder)
static constexpr intptr_t kMaxCaptures
static void ParseRegExp(const String &input, RegExpFlags regexp_flags, RegExpCompileData *result)
bool ParsePropertyClassName(ZoneGrowableArray< char > *name_1, ZoneGrowableArray< char > *name_2)
intptr_t captures_started()
virtual intptr_t max_match() const =0
static constexpr intptr_t kInfinity
virtual bool IsTextElement() const
static SmiPtr New(intptr_t value)
static StringPtr ConcatAll(const Array &strings, Heap::Space space=Heap::kNew)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
uint16_t CharAt(intptr_t index) const
static StringPtr FromUTF16(const uint16_t *utf16_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static const String & Blank()
static constexpr int32_t kLeadSurrogateStart
static constexpr int32_t kMaxCodeUnit
static int32_t Decode(uint16_t lead, uint16_t trail)
static void Encode(int32_t codepoint, uint16_t *dst)
static bool IsLeadSurrogate(uint32_t ch)
static bool IsTrailSurrogate(uint32_t ch)
static constexpr int32_t kMaxCodePoint
static constexpr bool IsDecimalDigit(uint32_t c)
static constexpr bool IsAlphaNumeric(uint32_t c)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
static float max(float r, float g, float b)
static float min(float r, float g, float b)
static void PushCodeUnit(RegExpCaptureName *v, uint32_t code_unit)
static const char * kUnicodeIdentity
ZoneGrowableArray< uint16_t > RegExpCaptureName
static int HexValue(char digit)
static constexpr bool FLAG_regexp_possessive_quantifier
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set