Regex: Tweak definition of character class and control escape tables
This commit is contained in:
parent
df73b71dfc
commit
74ed102cab
|
@ -489,30 +489,32 @@ private:
|
||||||
Iterator m_pos;
|
Iterator m_pos;
|
||||||
bool m_ignore_case = false;
|
bool m_ignore_case = false;
|
||||||
|
|
||||||
struct CharacterClassEscape {
|
static constexpr struct CharacterClassEscape {
|
||||||
Codepoint cp;
|
Codepoint cp;
|
||||||
const char* ctype;
|
const char* ctype;
|
||||||
StringView additional_chars;
|
StringView additional_chars;
|
||||||
bool neg;
|
bool neg;
|
||||||
};
|
} character_class_escapes[] = {
|
||||||
static const CharacterClassEscape character_class_escapes[4];
|
|
||||||
|
|
||||||
struct ControlEscape { Codepoint name; Codepoint value; };
|
|
||||||
static const ControlEscape control_escapes[5];
|
|
||||||
};
|
|
||||||
|
|
||||||
// For some reason Gcc fails to link if this is constexpr
|
|
||||||
const RegexParser::CharacterClassEscape RegexParser::character_class_escapes[4] = {
|
|
||||||
{ 'd', "digit", "", false },
|
{ 'd', "digit", "", false },
|
||||||
{ 'w', "alnum", "_", false },
|
{ 'w', "alnum", "_", false },
|
||||||
{ 's', "space", "", false },
|
{ 's', "space", "", false },
|
||||||
{ 'h', nullptr, " \t", false },
|
{ 'h', nullptr, " \t", false },
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr struct ControlEscape {
|
||||||
|
Codepoint name;
|
||||||
|
Codepoint value;
|
||||||
|
} control_escapes[] = {
|
||||||
|
{ 'f', '\f' },
|
||||||
|
{ 'n', '\n' },
|
||||||
|
{ 'r', '\r' },
|
||||||
|
{ 't', '\t' },
|
||||||
|
{ 'v', '\v' }
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr RegexParser::CharacterClassEscape RegexParser::character_class_escapes[];
|
||||||
const RegexParser::ControlEscape RegexParser::control_escapes[5] = {
|
constexpr RegexParser::ControlEscape RegexParser::control_escapes[];
|
||||||
{ 'f', '\f' }, { 'n', '\n' }, { 'r', '\r' }, { 't', '\t' }, { 'v', '\v' }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RegexCompiler
|
struct RegexCompiler
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user