Added mapping of identifiers to valid names
このコミットが含まれているのは:
1 親
5def7d1a00
コミット
e711ef4c60
4ファイル変更
+61
-65
検索条件に一致するファイルはありません
@@ -165,5 +165,20 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
|
||||
return updatedNode;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override SyntaxToken VisitToken(SyntaxToken token)
|
||||
{
|
||||
SyntaxToken updatedToken = base.VisitToken(token);
|
||||
|
||||
// Replace all identifier tokens when needed, to avoid colliding with HLSL keywords
|
||||
if (updatedToken.IsKind(SyntaxKind.IdentifierToken) &&
|
||||
HlslKnownKeywords.TryGetMappedName(updatedToken.Text, out string? mapped))
|
||||
{
|
||||
return ParseToken(mapped!);
|
||||
}
|
||||
|
||||
return updatedToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする