YamlDotNet.Core.Scanner.ScanBlockScalarBreaks C# (CSharp) 메소드

ScanBlockScalarBreaks() 개인적인 메소드

Scan intendation spaces and line breaks for a block scalar. Determine the intendation level if needed.
private ScanBlockScalarBreaks ( int currentIndent, StringBuilder breaks, YamlDotNet.Core.Mark start, YamlDotNet.Core.Mark &end ) : int
currentIndent int
breaks StringBuilder
start YamlDotNet.Core.Mark
end YamlDotNet.Core.Mark
리턴 int
        private int ScanBlockScalarBreaks(int currentIndent, StringBuilder breaks, Mark start, ref Mark end)
        {
            int maxIndent = 0;

            end = cursor.Mark();

            // Eat the intendation spaces and line breaks.

            for (;;)
            {
                // Eat the intendation spaces.

                while ((currentIndent == 0 || cursor.LineOffset < currentIndent) && analyzer.IsSpace())
                {
                    Skip();
                }

                if (cursor.LineOffset > maxIndent)
                {
                    maxIndent = cursor.LineOffset;
                }

                // Check for a tab character messing the intendation.

                if ((currentIndent == 0 || cursor.LineOffset < currentIndent) && analyzer.IsTab())
                {
                    throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a block scalar, find a tab character where an intendation space is expected.");
                }

                // Have we find a non-empty line?

                if (!analyzer.IsBreak())
                {
                    break;
                }

                // Consume the line break.

                breaks.Append(ReadLine());

                end = cursor.Mark();
            }

            // Determine the indentation level if needed.

            if (currentIndent == 0)
            {
                currentIndent = Math.Max(maxIndent, Math.Max(indent + 1, 1));
            }

            return currentIndent;
        }