Esempio n. 1
0
        private void ReadHex()
        {
            while (char.IsLetterOrDigit(this.reader.Current))
            {
                int num = (int)this.reader.Read();
            }
            string text = this.reader.GetString(this.startPos + 2, this.reader.Position);

            foreach (char ch in text)
            {
                if (!Utils.IsHexDigit(ch))
                {
                    throw LexicalException.InvalidHex(text);
                }
            }
        }
Esempio n. 2
0
        void ReadHex()
        {
            while (char.IsLetterOrDigit(this.reader.Current))
            {
                this.reader.Read();
            }

            string s = this.reader.GetString(this.startPos + 2, this.reader.Position); // skip leading 0x

            foreach (char ch in s)
            {
                if (!Utils.IsHexDigit(ch))
                {
                    throw LexicalException.InvalidHex(s);
                }
            }
        }