forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityScriptCompilerOutputParser.cs
More file actions
56 lines (49 loc) · 2.22 KB
/
Copy pathUnityScriptCompilerOutputParser.cs
File metadata and controls
56 lines (49 loc) · 2.22 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
using System;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
namespace UnityEditor.Scripting.Compilers
{
internal class UnityScriptCompilerOutputParser : CompilerOutputParserBase
{
private static Regex sCompilerOutput = new Regex("\\s*(?<filename>.*)\\((?<line>\\d+),(?<column>\\d+)\\):\\s*[BU]C(?<type>W|E)(?<id>[^:]*):\\s*(?<message>.*)", RegexOptions.ExplicitCapture);
private static Regex sUnknownTypeOrNamespace = new Regex("[^']*'(?<type_name>[^']+)'.*", RegexOptions.ExplicitCapture | RegexOptions.Compiled);
[CompilerGenerated]
private static Func<Match, Regex, NormalizedCompilerStatus> <>f__mg$cache0;
[CompilerGenerated]
private static Func<Match, Regex, NormalizedCompilerStatus> <>f__mg$cache1;
protected override string GetErrorIdentifier()
{
return "E";
}
protected override Regex GetOutputRegex()
{
return UnityScriptCompilerOutputParser.sCompilerOutput;
}
protected override NormalizedCompilerStatus NormalizedStatusFor(Match match)
{
string arg_29_1 = "0018";
Regex arg_29_2 = UnityScriptCompilerOutputParser.sUnknownTypeOrNamespace;
if (UnityScriptCompilerOutputParser.<>f__mg$cache0 == null)
{
UnityScriptCompilerOutputParser.<>f__mg$cache0 = new Func<Match, Regex, NormalizedCompilerStatus>(CompilerOutputParserBase.NormalizeSimpleUnknownTypeOfNamespaceError);
}
NormalizedCompilerStatus normalizedCompilerStatus = CompilerOutputParserBase.TryNormalizeCompilerStatus(match, arg_29_1, arg_29_2, UnityScriptCompilerOutputParser.<>f__mg$cache0);
NormalizedCompilerStatus result;
if (normalizedCompilerStatus.code != NormalizedCompilerStatusCode.NotNormalized)
{
result = normalizedCompilerStatus;
}
else
{
string arg_6A_1 = "0005";
Regex arg_6A_2 = UnityScriptCompilerOutputParser.sUnknownTypeOrNamespace;
if (UnityScriptCompilerOutputParser.<>f__mg$cache1 == null)
{
UnityScriptCompilerOutputParser.<>f__mg$cache1 = new Func<Match, Regex, NormalizedCompilerStatus>(CompilerOutputParserBase.NormalizeSimpleUnknownTypeOfNamespaceError);
}
result = CompilerOutputParserBase.TryNormalizeCompilerStatus(match, arg_6A_1, arg_6A_2, UnityScriptCompilerOutputParser.<>f__mg$cache1);
}
return result;
}
}
}