Skip to content
Open
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
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,14 @@ There is intentionally **no** general `Icod.LineEditor.Shared` project. The comp

## Architecture

The permanent dependency direction is:
The current dependency direction is:

```text
Published neutral foundation
Icod.CommandFramework 2.1.0
↓ PackageReference
┌──────────────────────────────┐
│ Icod.LineEditor.Ed.Shared │
└──────────────────────────────┘
↓ ProjectReference
ed red

Icod.CommandFramework 2.1.0
↓ PackageReference
sed

ed red sed
\ | /
lineeditor
distribution router
```
| Project | Dependencies |
|---|---|
| `Icod.LineEditor.Ed.Shared` | `Icod.CommandFramework 2.1.0`, `Icod.Expressions 0.1.0-alpha.1`, `Icod.Processes 1.2.0` |
| `ed`, `red` | The repository-local Ed engine and aliased Expressions regex providers |
| `sed` | CommandFramework for command and text services, Expressions for GNU regex matching |
| `lineeditor` | Repository-local `ed`, `red`, and `sed` commands |

`ed` and `red` deliberately share the Ed engine through repository-local `ProjectReference` relationships. `sed` remains a separate execution engine. The `lineeditor` router references all three command projects only to provide in-process dispatch. No production project in this repository references `Icod.CoreUtils.Shared`.

Expand Down Expand Up @@ -185,7 +172,7 @@ The solution defines `Debug`, `Staging`, and `Release` configurations. Release b

Repository versioning is centralized in the root [`Directory.Build.props`](Directory.Build.props). This branch prepares the unpublished `2.0.0-alpha.1` prerelease: `VersionPrefix` is `2.0.0`, `VersionSuffix` is `alpha.1`, and the package version combines them. `AssemblyVersion` and `FileVersion` remain numeric `2.0.0.0`.

The prerelease moves the `ed`/`red` injectable regex provider from the CommandFramework assembly to `Icod.Expressions 0.1.0-alpha.1`. In-process callers of `EditorEngine` must reference `Icod.Expressions` and pass its provider type; this changes source and binary API identity. The command-line interfaces remain the same. Further API refactoring may occur before stable 2.0. `sed` will migrate in a separate change.
The prerelease moves the `ed`/`red` injectable regex provider and `sed` GNU regex matching from the CommandFramework assembly to `Icod.Expressions 0.1.0-alpha.1`. In-process callers of `EditorEngine` must reference `Icod.Expressions` and pass its provider type; this changes source and binary API identity. The command-line interfaces remain the same. Further API refactoring may occur before stable 2.0.

For a tagged release, the `v<semver>` tag must agree with the generated NuGet package version. The release workflow selects packages by their actual nuspec version, so a mismatched tag cannot silently publish a differently versioned package.

Expand Down
1 change: 1 addition & 0 deletions sed/Icod.LineEditor.Sed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Icod.CommandFramework" Version="2.1.0" />
<PackageReference Include="Icod.Expressions" Version="0.1.0-alpha.1" Aliases="Expressions" />
<PackageReference Include="Icod.Processes" Version="1.2.0" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions sed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ y transliterate characters

## REGULAR EXPRESSIONS

Regular expressions use the managed GNU BRE/ERE providers supplied by `Icod.CommandFramework`. Sed retains command-specific handling for empty-expression reuse, address and substitution modifiers, GNU escape preprocessing, occurrence selection, zero-length match progression, replacement expansion, and diagnostic presentation.
Regular expressions use the managed GNU BRE/ERE providers supplied by `Icod.Expressions`. Sed retains command-specific handling for empty-expression reuse, address and substitution modifiers, GNU escape preprocessing, occurrence selection, zero-length match progression, replacement expansion, and diagnostic presentation.

`--posix` narrows GNU extension handling without replacing the managed regular-expression engine. Locale-sensitive text behavior is selected through the command framework's text and regular-expression contracts.
`--posix` narrows GNU extension handling without replacing the managed regular-expression engine. Locale-sensitive text behavior is selected through the command framework's text contracts and the Expressions regular-expression character classes.

## RECORD AND TEXT SEMANTICS

Expand Down Expand Up @@ -149,7 +149,7 @@ In-place editing uses the transactional replacement foundation supplied through

## PLATFORM NOTES

The project targets .NET 10 with C# 13 and is tested on Windows, Linux, and macOS. The core stream-editing engine is managed and does not invoke an external `sed` executable. Host-dependent process, filesystem, temporary-file, regular-expression, record, and transactional-replacement mechanics are supplied through .NET and `Icod.CommandFramework`.
The project targets .NET 10 with C# 13 and is tested on Windows, Linux, and macOS. The core stream-editing engine is managed and does not invoke an external `sed` executable. GNU regular expressions come from `Icod.Expressions`; host-dependent process, filesystem, temporary-file, record, text, and transactional-replacement mechanics remain in .NET and `Icod.CommandFramework`.

## AUTHORS

Expand Down
6 changes: 4 additions & 2 deletions sed/src/SedRegularExpressions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
extern alias Expressions;

namespace Icod.LineEditor.Sed;

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;
using Icod.CommandFramework.Text;

// Responsibility: Sed-specific regular-expression policy over the Shared GNU provider.
// Responsibility: Sed-specific regular-expression policy over the Icod.Expressions GNU provider.
public static partial class Command {

private enum SedRegularExpressionContext {
Expand Down
4 changes: 3 additions & 1 deletion sed/src/SedSubstitution.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern alias Expressions;

namespace Icod.LineEditor.Sed;

using System;
Expand All @@ -6,7 +8,7 @@ namespace Icod.LineEditor.Sed;
using System.IO;
using System.Linq;
using System.Text;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Icod.CommandFramework.CommandLine;
Expand Down
9 changes: 9 additions & 0 deletions tests/Sed.Tests/src/SedModuleBoundaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ namespace Icod.LineEditor.Sed.Tests;
/// Verifies the public and private boundaries retained by the LE1 source decomposition.
/// </summary>
public sealed class SedModuleBoundaryTests {
/// <summary>Verifies Sed's compiled matcher uses the published Expressions type.</summary>
[Fact]
public void CompiledRegexUsesExpressionsAssembly() {
var type = typeof( Icod.LineEditor.Sed.Command ).GetNestedType(
"SedCompiledRegularExpression", BindingFlags.NonPublic
)!;
var constructor = type.GetConstructors( BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic ).Single();
Assert.Equal( "Icod.Expressions", constructor.GetParameters()[0].ParameterType.Assembly.GetName().Name );
}

/// <summary>
/// Verifies that the established synchronous and asynchronous command signatures remain available.
Expand Down
Loading