Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FactoryInstanceFromCode()

RegexRunnerFactory System.Text.RegularExpressions.RegexLWCGCompiler.FactoryInstanceFromCode ( string pattern,
RegexCode code,
RegexOptions options,
bool hasTimeout )
inline

Definition at line 20 of file RegexLWCGCompiler.cs.

21 {
22 _code = code;
23 _codes = code.Codes;
24 _strings = code.Strings;
25 _leadingCharClasses = code.LeadingCharClasses;
26 _boyerMoorePrefix = code.BoyerMoorePrefix;
27 _leadingAnchor = code.LeadingAnchor;
28 _trackcount = code.TrackCount;
30 _hasTimeout = hasTimeout;
31 uint value = (uint)Interlocked.Increment(ref s_regexCount);
32 string value2 = string.Empty;
34 {
35 value2 = "_" + ((pattern.Length > 100) ? pattern.AsSpan(0, 100) : ((ReadOnlySpan<char>)pattern));
36 }
37 DynamicMethod goMethod = DefineDynamicMethod($"Regex{value}_Go{value2}", null, typeof(CompiledRegexRunner));
38 GenerateGo();
39 DynamicMethod findFirstCharMethod = DefineDynamicMethod($"Regex{value}_FindFirstChar{value2}", typeof(bool), typeof(CompiledRegexRunner));
41 return new CompiledRegexRunnerFactory(goMethod, findFirstCharMethod, _trackcount);
42 }
string bool CaseInsensitive[] _leadingCharClasses
DynamicMethod DefineDynamicMethod(string methname, Type returntype, Type hostType)
static int Increment(ref int location)

References System.Text.RegularExpressions.RegexCompiler._boyerMoorePrefix, System.Text.RegularExpressions.RegexCompiler._code, System.Text.RegularExpressions.RegexCompiler._codes, System.Text.RegularExpressions.RegexCompiler._hasTimeout, System.Text.RegularExpressions.RegexCompiler._leadingAnchor, System.Text.RegularExpressions.RegexCompiler._leadingCharClasses, System.Text.RegularExpressions.RegexCompiler._options, System.Text.RegularExpressions.RegexCompiler._strings, System.Text.RegularExpressions.RegexCompiler._trackcount, System.Text.RegularExpressions.RegexCode.BoyerMoorePrefix, System.Text.RegularExpressions.RegexCode.Codes, System.Text.RegularExpressions.RegexLWCGCompiler.DefineDynamicMethod(), System.Text.RegularExpressions.RegexCompiler.GenerateFindFirstChar(), System.Text.RegularExpressions.RegexCompiler.GenerateGo(), System.Threading.Interlocked.Increment(), System.Text.RegularExpressions.RegexCode.LeadingAnchor, System.Text.RegularExpressions.options, System.Text.RegularExpressions.pattern, System.Text.RegularExpressions.RegexLWCGCompiler.s_includePatternInName, System.Text.RegularExpressions.RegexLWCGCompiler.s_regexCount, System.Text.RegularExpressions.RegexCode.Strings, System.Text.RegularExpressions.RegexCode.TrackCount, and System.Text.RegularExpressions.value.

Referenced by System.Text.RegularExpressions.RegexCompiler.Compile().