ShaderInterpreter.Converter.RemovePreprocessorDirectives C# (CSharp) Method

RemovePreprocessorDirectives() public static method

Removes all recognizable preprocessor directives like //#ifdef, //#define, //#ifndef, //#endif, etc.
public static RemovePreprocessorDirectives ( string _Source ) : string
_Source string
return string
        public static string RemovePreprocessorDirectives( string _Source )
        {
            // First, check if there are #if blocks 'cause we can't support them at the moment!
            ErrorIfLinesWith( _Source, "#if " );
            ErrorIfLinesWith( _Source, "#if\t" );

            // Comment out other directives
            _Source = CommentLinesWith( _Source, "#ifdef" );
            _Source = CommentLinesWith( _Source, "#ifndef" );
            _Source = CommentLinesWith( _Source, "#endif" );
            _Source = CommentLinesWith( _Source, "#define" );

            return _Source;
        }