diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-07-20 23:22:07 +0430 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-07-20 21:25:59 +0100 |
commit | 598dc74a7607fd6c0cbf31ce614f1d30b7164aae (patch) | |
tree | 1e5e3546a9afb3587ec692676f7df467aaeebf00 /Userland/Libraries/LibC | |
parent | 77349149092dea81849eac1fee1799df8b3919a6 (diff) | |
download | serenity-598dc74a7607fd6c0cbf31ce614f1d30b7164aae.zip |
LibRegex: Partially implement the ECMAScript unicodeSets proposal
This skips the new string unicode properties additions, along with \q{}.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/regex.h | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/Userland/Libraries/LibC/regex.h b/Userland/Libraries/LibC/regex.h index d51c138a65..a850a43ae8 100644 --- a/Userland/Libraries/LibC/regex.h +++ b/Userland/Libraries/LibC/regex.h @@ -21,24 +21,25 @@ typedef struct { enum __Regex_Error { __Regex_NoError, - __Regex_InvalidPattern, // Invalid regular expression. - __Regex_InvalidCollationElement, // Invalid collating element referenced. - __Regex_InvalidCharacterClass, // Invalid character class type referenced. - __Regex_InvalidTrailingEscape, // Trailing \ in pattern. - __Regex_InvalidNumber, // Number in \digit invalid or in error. - __Regex_MismatchingBracket, // [ ] imbalance. - __Regex_MismatchingParen, // ( ) imbalance. - __Regex_MismatchingBrace, // { } imbalance. - __Regex_InvalidBraceContent, // Content of {} invalid: not a number, number too large, more than two numbers, first larger than second. - __Regex_InvalidBracketContent, // Content of [] invalid. - __Regex_InvalidRange, // Invalid endpoint in range expression. - __Regex_InvalidRepetitionMarker, // ?, * or + not preceded by valid regular expression. - __Regex_ReachedMaxRecursion, // MaximumRecursion has been reached. - __Regex_EmptySubExpression, // Sub expression has empty content. - __Regex_InvalidCaptureGroup, // Content of capture group is invalid. - __Regex_InvalidNameForCaptureGroup, // Name of capture group is invalid. - __Regex_InvalidNameForProperty, // Name of property is invalid. - __Regex_DuplicateNamedCapture, // Duplicate named capture group + __Regex_InvalidPattern, // Invalid regular expression. + __Regex_InvalidCollationElement, // Invalid collating element referenced. + __Regex_InvalidCharacterClass, // Invalid character class type referenced. + __Regex_InvalidTrailingEscape, // Trailing \ in pattern. + __Regex_InvalidNumber, // Number in \digit invalid or in error. + __Regex_MismatchingBracket, // [ ] imbalance. + __Regex_MismatchingParen, // ( ) imbalance. + __Regex_MismatchingBrace, // { } imbalance. + __Regex_InvalidBraceContent, // Content of {} invalid: not a number, number too large, more than two numbers, first larger than second. + __Regex_InvalidBracketContent, // Content of [] invalid. + __Regex_InvalidRange, // Invalid endpoint in range expression. + __Regex_InvalidRepetitionMarker, // ?, * or + not preceded by valid regular expression. + __Regex_ReachedMaxRecursion, // MaximumRecursion has been reached. + __Regex_EmptySubExpression, // Sub expression has empty content. + __Regex_InvalidCaptureGroup, // Content of capture group is invalid. + __Regex_InvalidNameForCaptureGroup, // Name of capture group is invalid. + __Regex_InvalidNameForProperty, // Name of property is invalid. + __Regex_DuplicateNamedCapture, // Duplicate named capture group + __Regex_InvalidCharacterClassEscape, // Invalid escaped entity in character class. }; enum ReError { @@ -82,10 +83,11 @@ enum __RegexAllFlags { __Regex_Multiline = __Regex_Global << 12, // Handle newline characters. Match each line, one by one. __Regex_SkipTrimEmptyMatches = __Regex_Global << 13, // Do not remove empty capture group results. __Regex_SingleMatch = __Regex_Global << 14, // Stop after acquiring a single match. - __Regex_Internal_Stateful = __Regex_Global << 15, // Internal flag; enables stateful matches. - __Regex_Internal_BrowserExtended = __Regex_Global << 16, // Internal flag; enable browser-specific ECMA262 extensions. - __Regex_Internal_ConsiderNewline = __Regex_Global << 17, // Internal flag; allow matchers to consider newlines as line separators. - __Regex_Last = __Regex_SingleMatch + __Regex_UnicodeSets = __Regex_Global << 15, // ECMA262 Parser specific: Allow set operations in char classes. + __Regex_Internal_Stateful = __Regex_Global << 16, // Internal flag; enables stateful matches. + __Regex_Internal_BrowserExtended = __Regex_Global << 17, // Internal flag; enable browser-specific ECMA262 extensions. + __Regex_Internal_ConsiderNewline = __Regex_Global << 18, // Internal flag; allow matchers to consider newlines as line separators. + __Regex_Last = __Regex_UnicodeSets, }; // Values for the cflags parameter to the regcomp() function: |