Patcher.Rules.RuleCompiler.CheckIllegalTokens C# (CSharp) Method

CheckIllegalTokens() private method

private CheckIllegalTokens ( string code ) : void
code string
return void
        private void CheckIllegalTokens(string code)
        {
            // Strip and compact code
            string stripped = StripBlanks(StripStrings(StripComments(code)));

            foreach (var token in IllegalCodeTokens)
            {
                if (stripped.Contains(token))
                {
                    throw new IllegalTokenException(string.Format("Illegal token '{0}' found in rule code" , token));
                }
            }
        }