YamlUtility.Grammar.YamlParser.ParseTagChar C# (CSharp) Method

ParseTagChar() private method

private ParseTagChar ( bool &success ) : char
success bool
return char
        private char ParseTagChar(out bool success)
        {
            int errorCount = Errors.Count;
            char ch = default(char);

            ch = ParseWordChar(out success);
            if (success) { ClearError(errorCount); return ch; }

            while (true)
            {
                int seq_start_position1 = position;
                MatchTerminal('%', out success);
                if (!success)
                {
                    Error("Failed to parse '%' of TagChar.");
                    break;
                }

                char char1 = ParseHexDigit(out success);
                if (!success)
                {
                    Error("Failed to parse char1 of TagChar.");
                    position = seq_start_position1;
                    break;
                }

                char char2 = ParseHexDigit(out success);
                if (success) { ch = Convert.ToChar(int.Parse(String.Format("{0}{1}", char1, char2), System.Globalization.NumberStyles.HexNumber)); }
                else
                {
                    Error("Failed to parse char2 of TagChar.");
                    position = seq_start_position1;
                }
                break;
            }
            if (success) { ClearError(errorCount); return ch; }

            MatchTerminalSet(";/?:@&=+$,_.~*'()[]", false, out success);
            if (success) { ClearError(errorCount); return ch; }

            return ch;
        }
YamlParser