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

StaleSimpleKeys() 개인적인 메소드

Check the list of potential simple keys and remove the positions that cannot contain simple keys anymore.
private StaleSimpleKeys ( ) : void
리턴 void
        private void StaleSimpleKeys()
        {
            // Check for a potential simple key for each flow level.

            foreach (var key in simpleKeys)
            {

                // The specification requires that a simple key

                //  - is limited to a single line,
                //  - is shorter than 1024 characters.

                if (key.IsPossible && (key.Line < cursor.Line || key.Index + 1024 < cursor.Index))
                {

                    // Check if the potential simple key to be removed is required.

                    if (key.IsRequired)
                    {
                        var mark = cursor.Mark();
                        throw new SyntaxErrorException(mark, mark, "While scanning a simple key, could not find expected ':'.");
                    }

                    key.IsPossible = false;
                }
            }
        }