Jurassic.Compiler.Lexer.ReadInteger C# (CSharp) Method

ReadInteger() private method

Reads an integer value.
private ReadInteger ( double initialValue, int &digitsRead ) : double
initialValue double The initial value, derived from the first character.
digitsRead int The number of digits that were read from the stream.
return double
        private double ReadInteger(double initialValue, out int digitsRead)
        {
            double result = initialValue;
            digitsRead = 0;

            while (true)
            {
                int c = this.reader.Peek();
                if (c < '0' || c > '9')
                    break;
                ReadNextChar();
                digitsRead++;
                result = result * 10 + (c - '0');
            }

            return result;
        }