コード例 #1
0
 public SyntaxCheckException(String message, SyntaxErrorType errorType, TextDocument document, Int32 offset, Int32 length, Exception innerException = null)
     : base(message, innerException)
 {
     _errorType   = errorType;
     _doc         = document ?? throw new ArgumentNullException("document");
     _errorOffset = offset;
     _errorLength = length;
 }
コード例 #2
0
        /// <summary>
        /// Creates a new lexical error token.
        /// </summary>
        /// <param name="errorType">The type of the error.</param>
        /// <param name="span">The location of the error.</param>
        public ErrorToken(SyntaxErrorType errorType, Span span) : base(TokenType.LexicalError, span)
        {
            if (errorType < SyntaxErrorType.InvalidEscapedIdentifier || errorType > SyntaxErrorType.InvalidDecimalLiteral)
            {
                throw new ArgumentOutOfRangeException("errorType");
            }

            _SyntaxError = new SyntaxError(errorType, span);
        }
コード例 #3
0
ファイル: SyntaxError.cs プロジェクト: wwkkww1983/vbconverter
        static public string GetErrorMessage(SyntaxErrorType type)
        {
            int    index   = (int)type;
            string message = "Unknown error.";

            if (index <= ErrorMessages.GetUpperBound(0))
            {
                message = ErrorMessages[index];
            }

            return(message);
        }
コード例 #4
0
ファイル: SyntaxError.cs プロジェクト: wwkkww1983/vbconverter
 /// <summary>
 /// Constructs a new syntax error.
 /// </summary>
 /// <param name="type">The type of the syntax error.</param>
 /// <param name="span">The location of the syntax error.</param>
 public SyntaxError(SyntaxErrorType type, Span span)
 {
     Debug.Assert(System.Enum.IsDefined(typeof(SyntaxErrorType), type));
     _Type = type;
     _Span = span;
 }