forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegexPattern.h
More file actions
65 lines (52 loc) · 1.95 KB
/
RegexPattern.h
File metadata and controls
65 lines (52 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
class JavascriptLibrary;
}
namespace UnifiedRegex
{
struct Program;
class Matcher;
struct TrigramInfo;
struct RegexPattern : FinalizableObject
{
struct UnifiedRep
{
Program* program;
Matcher* matcher;
TrigramInfo* trigramInfo;
};
Js::JavascriptLibrary *const library;
bool isLiteral : 1;
bool isShallowClone : 1;
union Rep
{
struct UnifiedRep unified;
} rep;
RegexPattern(Js::JavascriptLibrary *const library, Program* program, bool isLiteral);
static RegexPattern *New(Js::ScriptContext *scriptContext, Program* program, bool isLiteral);
virtual void Finalize(bool isShutdown) override;
virtual void Dispose(bool isShutdown) override;
virtual void Mark(Recycler *recycler) override { AssertMsg(false, "Mark called on object that isn't TrackableObject"); }
Js::ScriptContext *GetScriptContext() const;
inline bool IsLiteral() const { return isLiteral; }
int NumGroups() const;
bool IsIgnoreCase() const;
bool IsGlobal() const;
bool IsMultiline() const;
bool IsUnicode() const;
bool IsSticky() const;
bool WasLastMatchSuccessful() const;
GroupInfo GetGroup(int groupId) const;
Js::InternalString GetSource() const;
RegexFlags GetFlags() const;
#if ENABLE_REGEX_CONFIG_OPTIONS
void Print(DebugWriter* w);
#endif
RegexPattern *CopyToScriptContext(Js::ScriptContext *scriptContext);
};
}