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:
Karl Burtram
2019-02-07 20:13:03 -08:00
committed by GitHub
parent 0a172f3c8e
commit 022282800a
92 changed files with 2471 additions and 6391 deletions

View File

@@ -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; } }
}
}