mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-18 03:09:45 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
27 lines
508 B
C#
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 );
|
|
}
|
|
}
|
|
}
|