Пример #1
0
        private void ParseCommandChildren(CommandNode parent)
        {
            while (More())
            {
                if (CurrentToken.Type == TokenType.EndOfArguments)
                {
                    return;
                }

                var child =
                    ParseSubcommand(parent)
                    ?? (SyntaxNode?)ParseOption(parent)
                    ?? ParseCommandArgument(parent);

                if (child is null)
                {
                    UnmatchedTokens.Add(CurrentToken);
                    Advance();
                }
                else
                {
                    parent.AddChildNode(child);
                }
            }
        }