|
Lines 37-45
namespace JSC { namespace Yarr {
a/Source/JavaScriptCore/yarr/RegularExpression.cpp_sec1
|
| 37 |
|
37 |
|
| 38 |
class RegularExpression::Private : public RefCounted<RegularExpression::Private> { |
38 |
class RegularExpression::Private : public RefCounted<RegularExpression::Private> { |
| 39 |
public: |
39 |
public: |
| 40 |
static Ref<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) |
40 |
static Ref<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) |
| 41 |
{ |
41 |
{ |
| 42 |
return adoptRef(*new Private(pattern, caseSensitivity, multilineMode)); |
42 |
return adoptRef(*new Private(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)); |
| 43 |
} |
43 |
} |
| 44 |
|
44 |
|
| 45 |
int lastMatchLength { -1 }; |
45 |
int lastMatchLength { -1 }; |
|
Lines 48-59
class RegularExpression::Private : public RefCounted<RegularExpression::Private>
a/Source/JavaScriptCore/yarr/RegularExpression.cpp_sec2
|
| 48 |
std::unique_ptr<JSC::Yarr::BytecodePattern> m_regExpByteCode; |
48 |
std::unique_ptr<JSC::Yarr::BytecodePattern> m_regExpByteCode; |
| 49 |
|
49 |
|
| 50 |
private: |
50 |
private: |
| 51 |
Private(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) |
51 |
Private(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) |
| 52 |
: m_regExpByteCode(compile(pattern, caseSensitivity, multilineMode)) |
52 |
: m_regExpByteCode(compile(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)) |
| 53 |
{ |
53 |
{ |
| 54 |
} |
54 |
} |
| 55 |
|
55 |
|
| 56 |
std::unique_ptr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) |
56 |
std::unique_ptr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) |
| 57 |
{ |
57 |
{ |
| 58 |
RegExpFlags flags = NoFlags; |
58 |
RegExpFlags flags = NoFlags; |
| 59 |
|
59 |
|
|
Lines 63-68
class RegularExpression::Private : public RefCounted<RegularExpression::Private>
a/Source/JavaScriptCore/yarr/RegularExpression.cpp_sec3
|
| 63 |
if (multilineMode == MultilineEnabled) |
63 |
if (multilineMode == MultilineEnabled) |
| 64 |
flags = static_cast<RegExpFlags>(flags | FlagMultiline); |
64 |
flags = static_cast<RegExpFlags>(flags | FlagMultiline); |
| 65 |
|
65 |
|
|
|
66 |
if (unicodeCodePointMode == UnicodeCodePointAware) |
| 67 |
flags = static_cast<RegExpFlags>(flags | FlagUnicode); |
| 68 |
|
| 66 |
JSC::Yarr::YarrPattern pattern(patternString, flags, m_constructionErrorCode); |
69 |
JSC::Yarr::YarrPattern pattern(patternString, flags, m_constructionErrorCode); |
| 67 |
if (JSC::Yarr::hasError(m_constructionErrorCode)) { |
70 |
if (JSC::Yarr::hasError(m_constructionErrorCode)) { |
| 68 |
LOG_ERROR("RegularExpression: YARR compile failed with '%s'", JSC::Yarr::errorMessage(m_constructionErrorCode)); |
71 |
LOG_ERROR("RegularExpression: YARR compile failed with '%s'", JSC::Yarr::errorMessage(m_constructionErrorCode)); |
|
Lines 78-85
class RegularExpression::Private : public RefCounted<RegularExpression::Private>
a/Source/JavaScriptCore/yarr/RegularExpression.cpp_sec4
|
| 78 |
JSC::Yarr::ErrorCode m_constructionErrorCode { Yarr::ErrorCode::NoError }; |
81 |
JSC::Yarr::ErrorCode m_constructionErrorCode { Yarr::ErrorCode::NoError }; |
| 79 |
}; |
82 |
}; |
| 80 |
|
83 |
|
| 81 |
RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) |
84 |
RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) |
| 82 |
: d(Private::create(pattern, caseSensitivity, multilineMode)) |
85 |
: d(Private::create(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)) |
| 83 |
{ |
86 |
{ |
| 84 |
} |
87 |
} |
| 85 |
|
88 |
|