mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 09:35:36 -05:00
Move managed parser into its own project (test code coverage) (#774)
* Created New ManagedBatchParser project in .NetStandard * Addressing PR Comments * Resolve 'No Repository' warning. * Move batch parser tests to integrations test project * Fix SLN file
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
public sealed class BatchParserException : Exception
|
||||
{
|
||||
const string ErrorCodeName = "ErrorCode";
|
||||
const string BeginName = "Begin";
|
||||
const string EndName = "End";
|
||||
const string TextName = "Text";
|
||||
const string TokenTypeName = "TokenType";
|
||||
|
||||
ErrorCode errorCode;
|
||||
PositionStruct begin;
|
||||
PositionStruct end;
|
||||
string text;
|
||||
LexerTokenType tokenType;
|
||||
|
||||
/// <summary>
|
||||
/// Class for a custom exception for the Batch Parser
|
||||
/// </summary>
|
||||
public BatchParserException(ErrorCode errorCode, Token token, string message)
|
||||
: base(message)
|
||||
{
|
||||
this.errorCode = errorCode;
|
||||
begin = token.Begin;
|
||||
end = token.End;
|
||||
text = token.Text;
|
||||
tokenType = token.TokenType;
|
||||
}
|
||||
|
||||
public ErrorCode ErrorCode { get { return errorCode; } }
|
||||
|
||||
public PositionStruct Begin { get { return begin; } }
|
||||
|
||||
public PositionStruct End { get { return end; } }
|
||||
|
||||
public string Text { get { return text; } }
|
||||
|
||||
public LexerTokenType TokenType { get { return tokenType; } }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user