Skip to content

Commit

Permalink
Move expressions to their own folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Sep 9, 2024
1 parent 73acc40 commit 007b97f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Represents a query filter <see cref="QueryFilterTokenKind.CloseParenthesis"/> expression.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Provides a query filter expression.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Represents a query filter <see cref="QueryFilterTokenKind.Logical"/> expression.
Expand All @@ -24,7 +24,7 @@ public override bool CanAddToken(QueryFilterToken token)
return token.Kind == QueryFilterTokenKind.Not;

_isComplete = token.Kind == QueryFilterTokenKind.OpenParenthesis;
return _isComplete
return _isComplete
? false
: throw new QueryFilterParserException($"A '{_not.GetRawToken(Filter).ToString()}' expects an opening '(' to start an expression versus a syntactically incorrect '{token.GetValueToken(Filter)}' token.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Represents a query filter <see cref="QueryFilterTokenKind.OpenParenthesis"/> expression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using System.Collections.Generic;

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Represents a query filter <see cref="QueryFilterTokenKind.Operator"/> expression.
Expand Down Expand Up @@ -38,7 +38,7 @@ public sealed class QueryFilterOperatorExpression(QueryFilterParser parser, stri
public override bool IsComplete => _isComplete;

/// <inheritdoc/>
public override bool CanAddToken(QueryFilterToken token) => !_isComplete || (TokenCount == 1 && QueryFilterTokenKind.Operator.HasFlag(token.Kind));
public override bool CanAddToken(QueryFilterToken token) => !_isComplete || TokenCount == 1 && QueryFilterTokenKind.Operator.HasFlag(token.Kind);

/// <inheritdoc/>
protected override void AddToken(int index, QueryFilterToken token)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

namespace CoreEx.Data.Querying
namespace CoreEx.Data.Querying.Expressions
{
/// <summary>
/// Represents a query filter <see cref="QueryFilterTokenKind.StringFunction"/> expression.
Expand Down Expand Up @@ -40,7 +40,7 @@ public sealed class QueryFilterStringFunctionExpression(QueryFilterParser parser

/// <inheritdoc/>
protected override void AddToken(int index, QueryFilterToken token)
{
{
switch (index)
{
case 0:
Expand Down
1 change: 1 addition & 0 deletions src/CoreEx.Data/Querying/QueryFilterParser.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx

using CoreEx.Data.Querying.Expressions;
using CoreEx.RefData;
using System;
using System.Collections.Generic;
Expand Down

0 comments on commit 007b97f

Please sign in to comment.