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}'"); }