Fix parentheses error

This commit is contained in:
bobqianic 2024-02-20 17:08:19 +00:00 committed by GitHub
parent 5eebbf030e
commit 93e2c73dba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -193,7 +193,7 @@ private:
continue; continue;
} }
// ?\p{L}+ // ?\p{L}+
else if (unicode_engine.is_category(codepoint, "LETTER") || codepoint == 32 && unicode_engine.is_category(codepoint_next, "LETTER")) { else if (unicode_engine.is_category(codepoint, "LETTER") || (codepoint == 32 && unicode_engine.is_category(codepoint_next, "LETTER"))) {
codepoints_buffer.push_back(codepoint); codepoints_buffer.push_back(codepoint);
offset++; offset++;
while (offset < codepoints.size() && unicode_engine.is_category(codepoints[offset], "LETTER")) { while (offset < codepoints.size() && unicode_engine.is_category(codepoints[offset], "LETTER")) {
@ -202,7 +202,7 @@ private:
} }
} }
// ?\p{N}+ // ?\p{N}+
else if (unicode_engine.is_category(codepoint, "NUMBER") || codepoint == 32 && unicode_engine.is_category(codepoint_next, "NUMBER")) { else if (unicode_engine.is_category(codepoint, "NUMBER") || (codepoint == 32 && unicode_engine.is_category(codepoint_next, "NUMBER"))) {
codepoints_buffer.push_back(codepoint); codepoints_buffer.push_back(codepoint);
offset++; offset++;
while (offset < codepoints.size() && unicode_engine.is_category(codepoints[offset], "NUMBER")) { while (offset < codepoints.size() && unicode_engine.is_category(codepoints[offset], "NUMBER")) {
@ -211,7 +211,7 @@ private:
} }
} }
// ?[^\s\p{L}\p{N}]+ // ?[^\s\p{L}\p{N}]+
else if (!unicode_engine.is_category(codepoint, codepoint_rules_2) || codepoint == 32 && !unicode_engine.is_category(codepoint_next, codepoint_rules_2)) { else if (!unicode_engine.is_category(codepoint, codepoint_rules_2) || (codepoint == 32 && !unicode_engine.is_category(codepoint_next, codepoint_rules_2))) {
codepoints_buffer.push_back(codepoint); codepoints_buffer.push_back(codepoint);
offset++; offset++;
while (offset < codepoints.size() && !unicode_engine.is_category(codepoints[offset], codepoint_rules_2)) { while (offset < codepoints.size() && !unicode_engine.is_category(codepoints[offset], codepoint_rules_2)) {