YamlDotNet.Core.Scanner.RollIndent C# (CSharp) Method

RollIndent() private method

Push the current indentation level to the stack and set the new level the current column is greater than the indentation level. In this case, append or insert the specified token into the token queue.
private RollIndent ( int column, int number, bool isSequence, YamlDotNet.Core.Mark position ) : void
column int
number int
isSequence bool
position YamlDotNet.Core.Mark
return void
        private void RollIndent(int column, int number, bool isSequence, Mark position)
        {
            // In the flow context, do nothing.

            if (flowLevel > 0)
            {
                return;
            }

            if (indent < column)
            {

                // Push the current indentation level to the stack and set the new
                // indentation level.

                indents.Push(indent);

                indent = column;

                // Create a token and insert it into the queue.

                Token token;
                if (isSequence)
                {
                    token = new BlockSequenceStart(position, position);
                }
                else
                {
                    token = new BlockMappingStart(position, position);
                }

                if (number == -1)
                {
                    tokens.Enqueue(token);
                }
                else
                {
                    tokens.Insert(number - tokensParsed, token);
                }
            }
        }