ShaderTools.Hlsl.Parser.DirectiveParser.ParseEndIfDirective C# (CSharp) Method

ParseEndIfDirective() private method

private ParseEndIfDirective ( SyntaxToken hash, SyntaxToken keyword, bool isActive, bool endIsActive ) : DirectiveTriviaSyntax
hash SyntaxToken
keyword SyntaxToken
isActive bool
endIsActive bool
return DirectiveTriviaSyntax
        private DirectiveTriviaSyntax ParseEndIfDirective(SyntaxToken hash, SyntaxToken keyword, bool isActive, bool endIsActive)
        {
            var eod = ParseEndOfDirective(false);

            if (_directiveStack.HasUnfinishedIf())
                return new EndIfDirectiveTriviaSyntax(hash, keyword, eod, endIsActive);

            return WithDiagnostic(new BadDirectiveTriviaSyntax(hash, keyword, eod, isActive), DiagnosticId.UnexpectedDirective, $"Unexpected directive: '{keyword}'");
        }