Exemplo n.º 1
0
        public static void AdvanceStreamPosition(this ITokenStream tokenStream)
        {
            if (tokenStream == null)
            {
                throw new ArgumentNullException(nameof(tokenStream));
            }

            if (tokenStream.IsEndOfStream())
            {
                throw new InvalidOperationException($"'{nameof(tokenStream)}' is at the end. Cannot advance.");
            }

            tokenStream.Position++;
        }