Any error during parsing will be noted as an instance of this class.
示例#1
0
 /// <summary>
 /// Add a parse error to the list of parse errors with the block causing the error.
 /// </summary>
 /// <param name="error">The parse error, which occured.</param>
 /// <param name="part">The part where the error occured.</param>
 /// <returns>The current parse engine.</returns>
 internal ParseEngine AddError(YAMPParseError error, Block part)
 {
     error.Part = part;
     return AddError(error);
 }
示例#2
0
        /// <summary>
        /// Add a parse error to the list of parse errors.
        /// </summary>
        /// <param name="error">The parse error, which occured.</param>
        /// <returns>The current parse engine.</returns>
        internal ParseEngine AddError(YAMPParseError error)
        {
            if (_errors.Count != 0)
            {
                var lerr = _errors[_errors.Count - 1];

                if (lerr.Column == error.Column && lerr.Line == error.Line)
                {
                    if (_ptr < _characters.Length - 1)
                    {
                        Advance();
                    }
                    else
                    {
                        _parsing = false;
                    }

                    return this;
                }
            }

            _errors.Add(error);
            return this;
        }