Skip to content

Commit

Permalink
Merge branch 'master' into stef-786-parsed-double-quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Jun 25, 2024
2 parents ee87a26 + 8cbe295 commit 6fbf137
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 244 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build with Tests

on: [push]
on:
push:
workflow_dispatch:
pull_request:
types: [opened, edited]

jobs:
build_and_test_Windows:
Expand All @@ -13,6 +17,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build
run: |
Expand All @@ -38,12 +44,6 @@ jobs:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Set JAVA_HOME to JDK 17
shell: pwsh
run: |
$jdkPath = $env:JAVA_HOME_17_X64
echo "JAVA_HOME=$jdkPath" >> $GITHUB_ENV
- name: Install dotnet tools
run: |
dotnet tool install --global dotnet-sonarscanner
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.4.2 (25 June 2024)
- [#824](https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/824) - Fixed: Incorrect Handling of Qualifiers in ConstantExpressionHelper contributed by [RenanCarlosPereira](https://github.com/RenanCarlosPereira)
- [#821](https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/821) - Incorrect Handling of Qualifiers in ConstantExpressionHelper [bug]

# v1.4.1 (21 June 2024)
- [#819](https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/819) - Update EntityFramework to version 6.5 to fix CVE [feature] contributed by [StefH](https://github.com/StefH)
- [#820](https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/820) - Use Testcontainers.MsSql for unit tests [test] contributed by [StefH](https://github.com/StefH)
Expand Down
4 changes: 2 additions & 2 deletions Generate-ReleaseNotes.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rem https://github.com/StefH/GitHubReleaseNotes

SET version=v1.4.1
SET version=v1.4.2

GitHubReleaseNotes --output CHANGELOG.md --exclude-labels invalid question documentation wontfix --language en --version %version% --token %GH_TOKEN%
GitHubReleaseNotes --output CHANGELOG.md --exclude-labels invalid question documentation wontfix environment --language en --version %version% --token %GH_TOKEN%
4 changes: 0 additions & 4 deletions System.Linq.Dynamic.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.deployment = .deployment
.editorconfig = .editorconfig
azure-pipelines.yml = azure-pipelines.yml
CHANGELOG.md = CHANGELOG.md
Directory.Build.props = Directory.Build.props
Generate-ReleaseNotes.bat = Generate-ReleaseNotes.bat
Expand Down Expand Up @@ -132,9 +131,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp_net6.0_EF6_Sqlite", "src-console\ConsoleAppEF6_Sqlite\ConsoleApp_net6.0_EF6_Sqlite.csproj", "{CA03FD55-9DAB-4827-9A35-A96D3804B311}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src-examples", "src-examples", "{BCA2A024-9032-4E56-A6C4-17A15D921728}"
ProjectSection(SolutionItems) = preProject
src-examples\README.md = src-examples\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeFirst.DataAccess", "src-examples\CodeFirst.DataAccess\CodeFirst.DataAccess.csproj", "{E36D1A08-F3ED-48C7-9DBF-8F625974A6C4}"
EndProject
Expand Down
96 changes: 0 additions & 96 deletions azure-pipelines.yml

This file was deleted.

25 changes: 20 additions & 5 deletions src/System.Linq.Dynamic.Core/Parser/NumberParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Globalization;
using System.Globalization;
using System.Linq.Dynamic.Core.Exceptions;
using System.Linq.Dynamic.Core.Validation;
using System.Linq.Expressions;
Expand Down Expand Up @@ -161,19 +161,34 @@ public Expression ParseIntegerLiteral(int tokenPosition, string text)
/// </summary>
public Expression ParseRealLiteral(string text, char qualifier, bool stripQualifier)
{
if (stripQualifier)
{
var pos = text.Length - 1;
while (pos >= 0 && Qualifiers.Contains(text[pos]))
{
pos--;
}

if (pos < text.Length - 1)
{
qualifier = text[pos + 1];
text = text.Substring(0, pos + 1);
}
}

switch (qualifier)
{
case 'f':
case 'F':
return _constantExpressionHelper.CreateLiteral(ParseNumber(stripQualifier ? text.Substring(0, text.Length - 1) : text, typeof(float))!, text);
return _constantExpressionHelper.CreateLiteral(ParseNumber(text, typeof(float))!, text);

case 'm':
case 'M':
return _constantExpressionHelper.CreateLiteral(ParseNumber(stripQualifier ? text.Substring(0, text.Length - 1) : text, typeof(decimal))!, text);
return _constantExpressionHelper.CreateLiteral(ParseNumber(text, typeof(decimal))!, text);

case 'd':
case 'D':
return _constantExpressionHelper.CreateLiteral(ParseNumber(stripQualifier ? text.Substring(0, text.Length - 1) : text, typeof(double))!, text);
return _constantExpressionHelper.CreateLiteral(ParseNumber(text, typeof(double))!, text);

default:
return _constantExpressionHelper.CreateLiteral(ParseNumber(text, typeof(double))!, text);
Expand Down Expand Up @@ -298,4 +313,4 @@ private Expression ParseAsBinary(int tokenPosition, string text, bool isNegative
throw new ParseException(string.Format(_culture, Res.InvalidBinaryIntegerLiteral, text), tokenPosition);
}
}
}
}
1 change: 1 addition & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>

<!-- https://github.com/coverlet-coverage/coverlet/issues/1391 -->
<CollectCoverage>true</CollectCoverage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);NETCOREAPP;EFCORE;EFCORE_3X;NETCOREAPP3_1;AspNetCoreIdentity</DefineConstants>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<AssemblyName>System.Linq.Dynamic.Core.Tests</AssemblyName>
<DebugType>full</DebugType>
<SignAssembly>True</SignAssembly>
<Nullable>enable</Nullable>
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
<ProjectGuid>{7AFC2836-0F6E-4B0D-8BB3-13317A3B6616}</ProjectGuid>
<DefineConstants>$(DefineConstants);EFCORE;EFCORE_3X;AspNetCoreIdentity</DefineConstants>
Expand Down
Loading

0 comments on commit 6fbf137

Please sign in to comment.