示例#1
0
        /// <summary>
        /// Collects an unexpected token error and advances to next token.
        /// </summary>
        public void CollectError()
        {
            // Should not be here if script ended.
            if (_tokenIt.IsEnded)
            {
                throw _tokenIt.BuildEndOfScriptException();
            }

            // Store the error.
            var ex = _tokenIt.BuildSyntaxUnexpectedTokenException();

            this._parseErrors.Add(ex);

            // Now advance to next token to continue parsing.
            _tokenIt.Advance();
        }
示例#2
0
 /// <summary>
 /// Match the current token to the token supplied.
 /// </summary>
 /// <param name="count">The number of positions to move forward</param>
 /// <param name="passNewLine">Whether or not to pass a new line token</param>
 protected void Advance(int count = 1, bool passNewLine = true)
 {
     _tokenIt.Advance(count, passNewLine);
 }