Exemple #1
0
        /// <summary>
        /// Advance the cursor forward given number of characters
        /// </summary>
        /// <param name="step">Value of step to MoveNext</param>
        private void MoveNext(int step = 1)
        {
            try
            {
                for (int i = 0; i < step; i++)
                {
                    // reset position when there is a newline
                    if (CurrentCharacter.Equals("\n"))
                    {
                        _position = 0;
                        _line++;
                    }

                    _input = _input.Remove(0, 1);
                    _position++;
                }
            }
            catch (ArgumentOutOfRangeException)
            {
                _input = "";
            }
        }