<commit_before>﻿namespace Uri.Grammar
{
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Linq;

    using Text.Scanning;
    using Int16Colon = Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>;
    using Int16Sequence2 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence3 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence4 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence5 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence6 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;

    public class IPv6AddressLexer : Lexer<IPv6Address>
    {
        private readonly ILexer<HexadecimalInt16> hexadecimalInt16Lexer;

        private readonly ILexer<LeastSignificantInt32> leastSignificantInt32Lexer;

        public IPv6AddressLexer()
            : this(new HexadecimalInt16Lexer(), new LeastSignificantInt32Lexer())
        {
        }

        public IPv6AddressLexer(ILexer<HexadecimalInt16> hexadecimalInt16Lexer, ILexer<LeastSignificantInt32> leastSignificantInt32Lexer)
            : base("IPv6address")
        {
            Contract.Requires(hexadecimalInt16Lexer != null);
            Contract.Requires(leastSignificantInt32Lexer != null);
            this.hexadecimalInt16Lexer = hexadecimalInt16Lexer;
            this.leastSignificantInt32Lexer = leastSignificantInt32Lexer;
        }

        public override bool TryRead(ITextScanner scanner, out IPv6Address element)
        {
            if (scanner.EndOfInput)
            {
                element = default(IPv6Address);
                return false;
            }

            if (this.TryReadFirstPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSecondPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadThirdPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadFourthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadFifthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSixthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSeventhPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadEighthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadNinthPass(scanner, out element))
            {
                return true;
            }

            element = default(IPv6Address);
            return false;
        }

        private IList<Int16Colon> ReadOptionalHexadecimalInt16s(ITextScanner scanner, int count)
        {
            var elements = new List<Int16Colon>(count);
            for (int i = 0; i < count; i++)
            {
                Int16Colon hexadecimalInt16;
                if (!this.TryReadInt16AndSeparator(scanner, out hexadecimalInt16))
                {
                    break;
                }

                elements.Add(hexadecimalInt16);
            }

            return elements;
        }

        private IList<Element> ReadOptionalInt16s(ITextScanner scanner, int count)
        {
            var elements = new List<Element>(count + 1);
            Sequence<Element, Element> colons;
            for (int i = 0; i < count; i++)
            {
                if (this.TryReadColons(scanner, out colons))
                {
                    elements.Add(colons);
                    return elements;
                }

                HexadecimalInt16 int16;
                if (!this.hexadecimalInt16Lexer.TryRead(scanner, out int16))
                {
                    for (int j = elements.Count - 1; j >= 0; j--)
                    {
                        var element = elements[j];
                        scanner.PutBack(element.Data);
                    }

                    return null;
                }

                if (this.TryReadColons(scanner, out colons))
                {
                    elements.Add(int16);
                    elements.Add(colons);
                    return elements;<commit_msg>Removing unused code from 'IPv6AddressLexer'<commit_after>﻿namespace Uri.Grammar
{
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Linq;

    using Text.Scanning;
    using Int16Colon = Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>;
    using Int16Sequence2 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence3 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence4 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence5 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;
    using Int16Sequence6 = Text.Scanning.Sequence<Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>, Text.Scanning.Sequence<HexadecimalInt16, Text.Scanning.Element>>;

    public class IPv6AddressLexer : Lexer<IPv6Address>
    {
        private readonly ILexer<HexadecimalInt16> hexadecimalInt16Lexer;

        private readonly ILexer<LeastSignificantInt32> leastSignificantInt32Lexer;

        public IPv6AddressLexer()
            : this(new HexadecimalInt16Lexer(), new LeastSignificantInt32Lexer())
        {
        }

        public IPv6AddressLexer(ILexer<HexadecimalInt16> hexadecimalInt16Lexer, ILexer<LeastSignificantInt32> leastSignificantInt32Lexer)
            : base("IPv6address")
        {
            Contract.Requires(hexadecimalInt16Lexer != null);
            Contract.Requires(leastSignificantInt32Lexer != null);
            this.hexadecimalInt16Lexer = hexadecimalInt16Lexer;
            this.leastSignificantInt32Lexer = leastSignificantInt32Lexer;
        }

        public override bool TryRead(ITextScanner scanner, out IPv6Address element)
        {
            if (scanner.EndOfInput)
            {
                element = default(IPv6Address);
                return false;
            }

            if (this.TryReadFirstPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSecondPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadThirdPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadFourthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadFifthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSixthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadSeventhPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadEighthPass(scanner, out element))
            {
                return true;
            }

            if (this.TryReadNinthPass(scanner, out element))
            {
                return true;
            }

            element = default(IPv6Address);
            return false;
        }

        private IList<Element> ReadOptionalInt16s(ITextScanner scanner, int count)
        {
            var elements = new List<Element>(count + 1);
            Sequence<Element, Element> colons;
            for (int i = 0; i < count; i++)
            {
                if (this.TryReadColons(scanner, out colons))
                {
                    elements.Add(colons);
                    return elements;
                }

                HexadecimalInt16 int16;
                if (!this.hexadecimalInt16Lexer.TryRead(scanner, out int16))
                {
                    for (int j = elements.Count - 1; j >= 0; j--)
                    {
                        var element = elements[j];
                        scanner.PutBack(element.Data);
                    }

                    return null;
                }

                if (this.TryReadColons(scanner, out colons))
                {
                    elements.Add(int16);
                    elements.Add(colons);
                    return elements;
{'fraction_non_alphanumeric': 0.08884935867428144, 'fraction_numerical': 0.02321879973785226, 'mean_word_length': 2.052, 'pattern_counts': {'":': 0, '<': 76, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1348182', 'n_tokens_mistral': 3272, 'n_tokens_neox': 2967, 'n_words': 478}