ShaderTools.Hlsl.Parser.HlslLexer.LexExcludedDirectivesAndTrivia C# (CSharp) Method

LexExcludedDirectivesAndTrivia() private method

private LexExcludedDirectivesAndTrivia ( bool endIsActive, List triviaList ) : void
endIsActive bool
triviaList List
return void
        private void LexExcludedDirectivesAndTrivia(bool endIsActive, List<SyntaxNode> triviaList)
        {
            while (true)
            {
                bool hasFollowingDirective;
                var text = LexDisabledText(out hasFollowingDirective);
                if (text != null)
                    triviaList.Add(text);

                if (!hasFollowingDirective)
                    break;

                var directive = LexSingleDirective(false, endIsActive, false, triviaList);
                var branching = directive as BranchingDirectiveTriviaSyntax;
                if (directive.Kind == SyntaxKind.EndIfDirectiveTrivia || (branching != null && branching.BranchTaken))
                    break;

                if (directive.Kind.IsIfLikeDirective())
                    LexExcludedDirectivesAndTrivia(false, triviaList);
            }
        }