Fixed invalid variable names in C#/HLSL

このコミットが含まれているのは:
Sergio Pedri committed 2020-08-26 13:39:01 +02:00
1 親 fa34296360
コミット c3dcaa0e7c
1ファイル変更
+3
+3
ファイルの表示
@@ -218,6 +218,9 @@ namespace ComputeSharp.Shaders.Translation
// Replace the discards
source = Regex.Replace(source, @"(?<!\w)out ([\w.]+) _(?!_)", m => $"out {m.Groups[1].Value} {new string(Guid.NewGuid().ToByteArray().Select(b => (char)('a' + b % 26)).ToArray())}");
// Fix invalid C# names with @ prefix
source = Regex.Replace(source, @"@(\w+)", m => $"__at__{m.Groups[1].Value}");
// Load the syntax tree and the entry node
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source);
MethodDeclarationSyntax rootNode = syntaxTree