Files
sbox-public/engine/Sandbox.Compiling/Compiler/Blacklist/Rules.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

27 lines
508 B
C#

using System.Text.RegularExpressions;
namespace Sandbox;
static partial class CompilerRules
{
public static List<Regex> Blacklist = new();
static CompilerRules()
{
AddRules( Methods );
AddRules( Attributes );
}
static void AddRules( IEnumerable<string> rules )
{
foreach ( var rule in rules )
{
var wildcard = Regex.Escape( rule ).Replace( "\\*", ".*" );
wildcard = $"^{wildcard}$";
var regex = new Regex( wildcard, RegexOptions.Compiled );
Blacklist.Add( regex );
}
}
}