Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on Keep a Changelog.

## [Unreleased]

## [2.0.3] - 2026-06-19

- **Esolang.Processor.Abstractions**: add InputLineEvent and InputStringEvent, OutputLineEvent, OutputStringEvent to IOEvent.

## [2.0.2] - 2026-06-02

### Fix
Expand All @@ -16,38 +20,38 @@ The format is based on Keep a Changelog.

### Fix

- **Esolang.Interpreter.Abstractions** / **Esolang.Processor.Abstractions** / **Esolang.Processor.Extensions.IO** :
- add AOT compatibility settings for net10.0 target framework
- **Esolang.Interpreter.Abstractions** / **Esolang.Processor.Abstractions** / **Esolang.Processor.Extensions.IO** :
- add AOT compatibility settings for net10.0 target framework

## [2.0.0] - 2026-06-02

### Added

- **Esolang.Processor.Abstractions**:
- Introduced `IEventProcessor` for a unified, event-driven execution model.
- Added `IOEvent` and its subtypes (`InputChar`, `InputInt`, `OutputChar`, `OutputInt`, `End`) to represent I/O operations.
- Added `IProcessor` as a non-generic base interface.
- Introduced `IEventProcessor` for a unified, event-driven execution model.
- Added `IOEvent` and its subtypes (`InputChar`, `InputInt`, `OutputChar`, `OutputInt`, `End`) to represent I/O operations.
- Added `IProcessor` as a non-generic base interface.
- **Esolang.Generator.Abstractions**:
- Added comprehensive abstractions for method signature binding and type resolution.
- Introduced `MethodSignatureBinder` for mapping esolang source to C# partial methods.
- Added `KnownTypes` for standardized Roslyn type resolution.
- Added `BindingError` record hierarchy for type-safe diagnostic reporting.
- Added `MethodInputKind`, `MethodOutputKind`, and `MethodReturnKind` for signature classification.
- Added comprehensive abstractions for method signature binding and type resolution.
- Introduced `MethodSignatureBinder` for mapping esolang source to C# partial methods.
- Added `KnownTypes` for standardized Roslyn type resolution.
- Added `BindingError` record hierarchy for type-safe diagnostic reporting.
- Added `MethodInputKind`, `MethodOutputKind`, and `MethodReturnKind` for signature classification.
- **Esolang.Interpreter.Abstractions**:
- Added new project for common interpreter utilities.
- Introduced `RunToConsoleAsync` extension method for running processors with standard console I/O.
- Added new project for common interpreter utilities.
- Introduced `RunToConsoleAsync` extension method for running processors with standard console I/O.
- **Esolang.Processor.Extensions.IO**:
- Extracted and standardized I/O extension methods into a dedicated project.
- Added `RunToEndAsync` overloads for `TextReader`/`TextWriter`, `string`/`StringBuilder`, and `PipeReader`/`PipeWriter`.
- Added `RunToStringAsync` for capturing output as a string.
- Extracted and standardized I/O extension methods into a dedicated project.
- Added `RunToEndAsync` overloads for `TextReader`/`TextWriter`, `string`/`StringBuilder`, and `PipeReader`/`PipeWriter`.
- Added `RunToStringAsync` for capturing output as a string.
- Enhanced testing infrastructure across all abstraction projects, significantly improving code coverage.

### Changed

- **Esolang.Processor.Abstractions** (Breaking Changes):
- Removed `ITextProcessor<TProgram>` and `IPipeProcessor<TProgram>` interfaces in favor of the event-driven `IEventProcessor`.
- Modernized interfaces to use `IAsyncEnumerable<IOEvent>` for execution.
- Standardized naming and namespaces.
- Removed `ITextProcessor<TProgram>` and `IPipeProcessor<TProgram>` interfaces in favor of the event-driven `IEventProcessor`.
- Modernized interfaces to use `IAsyncEnumerable<IOEvent>` for execution.
- Standardized naming and namespaces.
- Updated `.editorconfig` with stricter C# style and MSTest diagnostic rules.

## [1.0.0] - 2026-05-07
Expand All @@ -61,7 +65,8 @@ The format is based on Keep a Changelog.
- Both text and pipe processors return exit codes (`int`) from execution.
- Support for optional `CancellationToken` on all execution methods.

[Unreleased]: https://github.com/Esolang-NET/Abstractions/compare/v2.0.2...HEAD
[Unreleased]: https://github.com/Esolang-NET/Abstractions/compare/v2.0.3...HEAD
[2.0.3]: https://github.com/Esolang-NET/Abstractions/tree/v2.0.3
[2.0.2]: https://github.com/Esolang-NET/Abstractions/tree/v2.0.2
[2.0.1]: https://github.com/Esolang-NET/Abstractions/tree/v2.0.1
[2.0.0]: https://github.com/Esolang-NET/Abstractions/tree/v2.0.0
Expand Down
36 changes: 30 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>14</LangVersion>
<AssemblyVersion>2.0.0.2</AssemblyVersion>
<FileVersion>2.0.2.2</FileVersion>
<Version>2.0.2</Version>
<FileVersion>2.0.3.3</FileVersion>
<VersionPrefix>2.0.3</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageProjectUrl>https://github.com/Esolang-NET/Abstractions/</PackageProjectUrl>
<RepositoryUrl>https://github.com/Esolang-NET/Abstractions.git</RepositoryUrl>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -42,14 +43,37 @@
<CompilerVisibleProperty Include="ProjectDir" />
</ItemGroup>

<!-- #region test project settings -->
<PropertyGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.Tests')) == 'True'">
<TestResultsFolderPath>$(MSBuildProjectDirectory)\TestResults</TestResultsFolderPath>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsPublishable>false</IsPublishable>
<NoWarn>$(NoWarn);RS1035;CS1591</NoWarn>
<NoWarn>$(NoWarn);CS1591;IDE1006</NoWarn>
<OutputType>Exe</OutputType>
<EnableMSTestRunner>true</EnableMSTestRunner>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>

<ItemGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.Tests')) == 'True'">
<ProjectCapability Include="TestContainer" />

<PackageReference Include="TUnit" Version="1.54.0" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.8.0" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="2.2.3" />

<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage" />
</ItemGroup>

<!-- #region net462 or later specific settings -->
<PropertyGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.Tests')) == 'True' and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net462'))">
<EnableTUnitPolyfills>false</EnableTUnitPolyfills>

<NoWarn>$(NoWarn);CS0592;CS0436</NoWarn>
</PropertyGroup>

<ItemGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.Tests')) == 'True' and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net462'))">
<PackageReference Include="Polyfill" Version="10.8.1" PrivateAssets="all" />
<Compile Include="$(MSBuildThisFileDirectory)share/ExcludeFromCodeCoverageAttribute.cs" />
</ItemGroup>
<!-- #endregion -->
<!-- #endregion -->

</Project>
5 changes: 0 additions & 5 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
<PackageReference Update="Basic.Reference.Assemblies.Net472" Version="1.8.5" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Update="Microsoft.Testing.Extensions.CodeCoverage" Version="18.6.2" />
<PackageReference Update="Microsoft.Testing.Platform.MSBuild" Version="2.2.3" />
<PackageReference Update="MSTest.TestAdapter" Version="4.2.1" />
<PackageReference Update="MSTest.TestFramework" Version="4.2.1" />
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Update="PolySharp" Version="1.16.0" />
<PackageReference Update="System.Linq.AsyncEnumerable" Version="10.0.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Version="1.5.3" />
<PackageReference Include="Basic.Reference.Assemblies.Net100" />
<PackageReference Include="Basic.Reference.Assemblies.Net90" />
<PackageReference Include="Basic.Reference.Assemblies.Net472" />
<PackageReference Include="System.IO.Pipelines" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="System.IO.Pipelines" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageReference Include="System.Threading.Tasks.Extensions" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net48'">
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Generator.Abstractions\Esolang.Generator.Abstractions.csproj" />
</ItemGroup>
Expand Down
63 changes: 31 additions & 32 deletions Generator.Abstractions.Tests/KindTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@

namespace Esolang.Generator.Tests;

[TestClass]
public class KindTests
{
[TestMethod]
[SuppressMessage("MSTest", "MSTEST0032")]
public void MethodInputKind_HasExpectedValues()
[Test]
[SuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
public async Task MethodInputKind_HasExpectedValues()
{
Assert.AreEqual(0, (int)MethodInputKind.None);
Assert.AreEqual(1, (int)MethodInputKind.String);
Assert.AreEqual(2, (int)MethodInputKind.TextReader);
Assert.AreEqual(3, (int)MethodInputKind.PipeReader);
await Assert.That((int)MethodInputKind.None).IsEqualTo(0);
await Assert.That((int)MethodInputKind.String).IsEqualTo(1);
await Assert.That((int)MethodInputKind.TextReader).IsEqualTo(2);
await Assert.That((int)MethodInputKind.PipeReader).IsEqualTo(3);
}

[TestMethod]
[SuppressMessage("MSTest", "MSTEST0032")]
public void MethodOutputKind_HasExpectedValues()
[Test]
[SuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
public async Task MethodOutputKind_HasExpectedValues()
{
Assert.AreEqual(0, (int)MethodOutputKind.None);
Assert.AreEqual(1, (int)MethodOutputKind.TextWriter);
Assert.AreEqual(2, (int)MethodOutputKind.PipeWriter);
await Assert.That((int)MethodOutputKind.None).IsEqualTo(0);
await Assert.That((int)MethodOutputKind.TextWriter).IsEqualTo(1);
await Assert.That((int)MethodOutputKind.PipeWriter).IsEqualTo(2);
}

[TestMethod]
[SuppressMessage("MSTest", "MSTEST0032")]
public void MethodReturnKind_HasExpectedValues()
[Test]
[SuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
public async Task MethodReturnKind_HasExpectedValues()
{
Assert.AreEqual(0, (int)MethodReturnKind.Invalid);
Assert.AreEqual(1, (int)MethodReturnKind.Void);
Assert.AreEqual(2, (int)MethodReturnKind.Int32);
Assert.AreEqual(3, (int)MethodReturnKind.String);
Assert.AreEqual(4, (int)MethodReturnKind.NullableString);
Assert.AreEqual(5, (int)MethodReturnKind.Task);
Assert.AreEqual(6, (int)MethodReturnKind.TaskInt32);
Assert.AreEqual(7, (int)MethodReturnKind.TaskString);
Assert.AreEqual(8, (int)MethodReturnKind.TaskNullableString);
Assert.AreEqual(9, (int)MethodReturnKind.ValueTask);
Assert.AreEqual(10, (int)MethodReturnKind.ValueTaskInt32);
Assert.AreEqual(11, (int)MethodReturnKind.ValueTaskString);
Assert.AreEqual(12, (int)MethodReturnKind.ValueTaskNullableString);
Assert.AreEqual(13, (int)MethodReturnKind.IEnumerableByte);
Assert.AreEqual(14, (int)MethodReturnKind.IAsyncEnumerableByte);
await Assert.That((int)MethodReturnKind.Invalid).IsEqualTo(0);
await Assert.That((int)MethodReturnKind.Void).IsEqualTo(1);
await Assert.That((int)MethodReturnKind.Int32).IsEqualTo(2);
await Assert.That((int)MethodReturnKind.String).IsEqualTo(3);
await Assert.That((int)MethodReturnKind.NullableString).IsEqualTo(4);
await Assert.That((int)MethodReturnKind.Task).IsEqualTo(5);
await Assert.That((int)MethodReturnKind.TaskInt32).IsEqualTo(6);
await Assert.That((int)MethodReturnKind.TaskString).IsEqualTo(7);
await Assert.That((int)MethodReturnKind.TaskNullableString).IsEqualTo(8);
await Assert.That((int)MethodReturnKind.ValueTask).IsEqualTo(9);
await Assert.That((int)MethodReturnKind.ValueTaskInt32).IsEqualTo(10);
await Assert.That((int)MethodReturnKind.ValueTaskString).IsEqualTo(11);
await Assert.That((int)MethodReturnKind.ValueTaskNullableString).IsEqualTo(12);
await Assert.That((int)MethodReturnKind.IEnumerableByte).IsEqualTo(13);
await Assert.That((int)MethodReturnKind.IAsyncEnumerableByte).IsEqualTo(14);
}
}
Loading