Remove the demo text-parsing domain
The scaffolding domain existed to prove the shell end to end before there was
anything real to put in it. There is now, so it goes - as CLAUDE.md promised it
would.
Gone: the two sample parsers, ITextParser, ParsedRecord, the parser catalog,
ParseViewModel and ParseView, their tests, and the settings key that remembered
which parser was last used. ParseError.LineNumber becomes Index, since for a
listing "line 42" was simply untrue, and the error keys move from Parse.Error.*
to Collect.Error.* now that parsing is not a concept here.
Kept: IParser<,>, ParseOutcome, ParseProgress and ParseError. The streaming
contract was always the general part - it was only ever the text-shaped closure
of it that was scaffolding.
Rendering the dashboard caught two keys that were referenced but never added
during the rename: the XAML was repointed and the resources were not. The parity
test could not see it, because it compares the two files against each other and
a key absent from both is consistent. That gap now has its own test, which reads
every {l:Loc} in the XAML and checks it resolves - a screenshot is too late and
too manual a way to find a missing string.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
fe62bcf53f
commit
f8744c930a
@@ -1,9 +1,9 @@
|
||||
namespace AvParser.Core.Parsing;
|
||||
|
||||
/// <summary>A recoverable problem with a single record. Parsing continues after one of these.</summary>
|
||||
/// <param name="LineNumber">1-based position of the offending record in the input.</param>
|
||||
/// <param name="Index">1-based position of the offending item: a line, or a place in a listing.</param>
|
||||
/// <param name="Message">What went wrong, phrased for a user rather than a developer.</param>
|
||||
public sealed record ParseError(int LineNumber, string Message)
|
||||
public sealed record ParseError(int Index, string Message)
|
||||
{
|
||||
/// <summary>
|
||||
/// Stable identifier for the kind of failure, or <see langword="null"/> when the message is
|
||||
@@ -11,7 +11,7 @@ public sealed record ParseError(int LineNumber, string Message)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The domain stays language-free: it produces an English message plus a code, and the UI
|
||||
/// translates <c>Parse.Error.{Code}</c> with <see cref="Arguments"/>, falling back to
|
||||
/// translates <c>Collect.Error.{Code}</c> with <see cref="Arguments"/>, falling back to
|
||||
/// <see cref="Message"/>. Without this, a Russian UI would still print English error text —
|
||||
/// and moving the strings themselves into the domain would drag localisation down there.
|
||||
/// </remarks>
|
||||
@@ -21,9 +21,9 @@ public sealed record ParseError(int LineNumber, string Message)
|
||||
public IReadOnlyList<object?> Arguments { get; init; } = [];
|
||||
|
||||
/// <summary>Creates an error carrying a translation code.</summary>
|
||||
public static ParseError Create(int lineNumber, string code, string message, params object?[] arguments) =>
|
||||
new(lineNumber, message) { Code = code, Arguments = arguments };
|
||||
public static ParseError Create(int index, string code, string message, params object?[] arguments) =>
|
||||
new(index, message) { Code = code, Arguments = arguments };
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => $"Line {LineNumber}: {Message}";
|
||||
public override string ToString() => $"#{Index}: {Message}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user