Skip to content

Commit

Permalink
Backport fixes from v3 (#213)
Browse files Browse the repository at this point in the history
Bumped version to 2.7.1

Back-ported bug fixes from v3.0.0-alpha:
#179 - Corrected DualFromZeroToTwo plural rule
#211 . Illegal placeholder characters that are not 8-bit, will no more throw unexpected ThrowByteOverflowException
  • Loading branch information
axunonb committed Oct 21, 2021
1 parent 3165fc7 commit ca28b30
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Latest Changes
====

v2.7.1
===
* **Fixed**: [#179](https://github.com/axuno/SmartFormat/issues/179) DualFromZeroToTwo plural rule. Thanks to [@OhSoGood](https://github.com/OhSoGood)
* **Fixed**: [#211](https://github.com/axuno/SmartFormat/issues/211) Illegal placeholder characters that are not 8-bit, will no more throw unexpected `ThrowByteOverflowException`. Thanks to [@bogatykh](https://github.com/bogatykh)

v2.7.0
===
* **Fixed** broken backward compatibilty introduced in v2.6.2 (issues referenced in [#148](https://github.com/axuno/SmartFormat/issues/148), [#147](https://github.com/axuno/SmartFormat/issues/147), [#143](https://github.com/axuno/SmartFormat/issues/143)).
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.7.0.{build}
version: 2.7.1.{build}
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
image: Visual Studio 2019
Expand All @@ -8,7 +8,7 @@ build_script:
- ps: dotnet add .\SmartFormat.Tests\SmartFormat.Tests.csproj package AltCover
- ps: dotnet build SmartFormat.sln /verbosity:minimal /t:rebuild /p:configuration=release /nowarn:CS1591,CS0618
- ps: |
$version = "2.7.0"
$version = "2.7.1"
$versionFile = $version + "." + ${env:APPVEYOR_BUILD_NUMBER}
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
Expand Down
6 changes: 3 additions & 3 deletions src/SmartFormat/Core/Parsing/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public Format ParseFormat(string format, string[] formatterExtensionNames)
currentPlaceholder.Selectors.Add(new Selector(Settings, format, lastI, i, operatorIndex,
selectorIndex));
else if (operatorIndex != i)
parsingErrors.AddIssue(current, $"'0x{Convert.ToByte(c):X}': " + parsingErrorText[ParsingError.TrailingOperatorsInSelector],
parsingErrors.AddIssue(current, $"'0x{Convert.ToUInt32(c):X}': " + parsingErrorText[ParsingError.TrailingOperatorsInSelector],
operatorIndex, i);
lastI = i + 1;

Expand All @@ -420,7 +420,7 @@ public Format ParseFormat(string format, string[] formatterExtensionNames)
currentPlaceholder.Selectors.Add(new Selector(Settings, format, lastI, i, operatorIndex,
selectorIndex));
else if (operatorIndex != i)
parsingErrors.AddIssue(current, $"'0x{Convert.ToByte(c):X}': " + parsingErrorText[ParsingError.TrailingOperatorsInSelector],
parsingErrors.AddIssue(current, $"'0x{Convert.ToUInt32(c):X}': " + parsingErrorText[ParsingError.TrailingOperatorsInSelector],
operatorIndex, i);
lastI = i + 1;

Expand All @@ -439,7 +439,7 @@ public Format ParseFormat(string format, string[] formatterExtensionNames)
|| _alphanumericSelectors && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z')
|| _allowedSelectorChars.IndexOf(c) != -1;
if (!isValidSelectorChar)
parsingErrors.AddIssue(current, $"'0x{Convert.ToByte(c):X}': " + parsingErrorText[ParsingError.InvalidCharactersInSelector],
parsingErrors.AddIssue(current, $"'0x{Convert.ToUInt32(c):X}': " + parsingErrorText[ParsingError.InvalidCharactersInSelector],
i, i + 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/SmartFormat/SmartFormat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<Description>A string composition library written in C# that can format data into a string with a minimal, intuitive syntax. It uses extensions to provide named placeholders, pluralization, gender conjugation, and time and list formatting.</Description>
<AssemblyTitle>SmartFormat</AssemblyTitle>
<Version>2.7.0</Version>
<FileVersion>2.7.0</FileVersion>
<Version>2.7.1</Version>
<FileVersion>2.7.1</FileVersion>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down

0 comments on commit ca28b30

Please sign in to comment.