Skip to content

Releases: dsisco11/TinyAst.Preprocessor

v0.4.3

Choose a tag to compare

@dsisco11 dsisco11 released this 25 Jan 07:25
dfc84e4

Release Notes: v0.4.3

  • Fixed line/column mapping inaccuracies reported by downstream users when source text contains complex newline patterns and trivia (e.g., comments).
  • Improved line boundary detection to ensure correct handling of:
    • LF / CRLF / mixed line endings
    • leading blank lines and consecutive blank lines
    • trailing newline producing a final empty line
    • multi-line /* ... */ comments containing embedded newlines
  • Added extensive unit test coverage for SyntaxTreeLineColumnMapper and SyntaxTreeLineBoundaryResolver, including strict contract checks (offsets are unique, strictly increasing, and within range).

v0.4.2

Choose a tag to compare

@dsisco11 dsisco11 released this 15 Jan 20:28
b6b23eb

Release Notes v0.4.2

Improvements

  • Improved source mapping for preprocessed output so merged offsets can be traced back to the correct original resource when using imports (including multiple imports and nested imports).

Testing / Reliability

  • Added an end-to-end integration test that validates source-map resolution across multiple imported resources.

Technical Notes

  • Source-map segments are now generated during the merge pipeline to avoid redundant tree walks.
  • Mapping boundaries account for SyntaxEditor.Replace(...) trivia transfer by splicing on the import directive’s token text span (so preserved trivia remains attributed to the importing file).

v0.4.1

Choose a tag to compare

@dsisco11 dsisco11 released this 11 Jan 12:58
9232c9b

Release Notes — Diagnostics Line/Column + C#-Style Output

  • Added line/column mapping for SyntaxTree diagnostics using IContentBoundaryResolver<SyntaxTree, LineBoundary> so locations can be reported as 1-based line,column (and spans as line,col,endLine,endCol).
  • Introduced a C#-compiler-style diagnostic formatter: resource(line,column): severity CODE: message.
  • Improved merge-time diagnostics to prefer human-friendly line:column output when available (instead of raw offset ranges).
  • Added/updated unit tests covering line boundary mapping and diagnostic formatting.

Compatibility Notes

  • Diagnostic text formatting may change compared to previous versions (locations are now line/column oriented and more compiler-like).

v0.4

Choose a tag to compare

@dsisco11 dsisco11 released this 11 Jan 10:36
55a9164

Release Notes — TinyAst.Preprocessor 0.4.0

Highlights

  • Upgraded to TinyPreprocessor v0.4 and aligned merge behavior with v0.4 semantics.
  • Added line-boundary support for SyntaxTree source-map boundary resolution.
  • Expanded test coverage for canonical ResourceId scenarios and redundant merge work prevention.

Breaking / Behavioral changes

  • Merge identity is now resolver-authoritative:
    • ResourceId is treated as opaque during merge (not required to be path-like).
    • Merge uses the resolver-produced resolved-id mapping (MergeContext.ResolvedReferences) per directive occurrence.
    • Merge no longer re-derives dependency IDs from raw reference strings (path heuristics).

New features

  • Boundary resolution support (Line boundaries):
    • Implemented IContentBoundaryResolver<SyntaxTree, LineBoundary> and a provider wired into the pipeline.
    • Enables boundary-aware source-map lookups (e.g., line index resolution) via TinyPreprocessor’s boundary extensions.

Improvements

  • No redundant merge work (validated by tests):
    • Shared dependencies and include-of-include graphs are processed exactly once per ResourceId.
  • Test instrumentation seam:
    • Added a protected virtual OnProcessResource(ResourceId) hook to observe per-resource processing in tests.

Documentation

  • Updated README and bridge docs to reflect:
    • TinyPreprocessor v0.4 requirement
    • resolved-id mapping merge semantics
    • boundary resolution capability
  • Added changelog and linked it from README.

Quality

  • Added XML documentation for public/protected APIs (eliminates CS1591 warnings).

v0.1

Choose a tag to compare

@dsisco11 dsisco11 released this 11 Jan 01:53

TinyAst.Preprocessor v0.1.0 — Release Notes (First Release)

Highlights

  • AST-native preprocessing on schema-bound SyntaxTree (no text re-parsing).
  • Import discovery via TinyAst Query (Query.Syntax<TImportNode>()) with locations anchored to node start (Position..Position).
  • Merge implemented via TinyAst SyntaxEditor (no green-node manipulation).
  • Full TinyPreprocessor 0.3.0+ pipeline support: dependency resolution, diagnostics, and source mapping.

New APIs

  • ImportDirective + ImportDirectiveModel for directive semantics and location modeling.
  • ImportDirectiveParser<TImportNode> (delegate-based): configure with Func<TImportNode, string?> getReference.
  • SyntaxTreeMergeStrategy<TImportNode, TContext> (delegate-based): same reference extractor used during merge.
  • SyntaxTreeContentModel implementing IContentModel<SyntaxTree>.
  • Test helpers: InMemorySyntaxTreeResourceStore, InMemorySyntaxTreeResourceResolver, ImportDirectiveLocationIndex.
  • Convenience wiring:
    • SyntaxTreePreprocessor<TImportNode, TContext> (one-stop preprocessor setup)
    • SyntaxTreePreprocessor<TImportNode> (context defaults to object)
    • SyntaxTreeBridge<TImportNode, TContext> (parser + merge strategy bundle)

Behavior / Design Notes

  • Schema binding is required (SyntaxTree.HasSchema == true) for directive discovery.
  • Reference extraction is non-invasive: downstream AST nodes do not need to implement any bridge interface.
  • Resolution failures can be pinned back to import locations via ImportDirectiveLocationIndex.

Diagnostics & Limits

  • Cycle detection (CircularDependencyDiagnostic) and max include depth enforcement (MaxDepthExceededDiagnostic) are covered by end-to-end tests.
  • Resolution failures produce ResolutionFailedDiagnostic and can carry location/resource context.

Packaging

  • NuGet packaging is configured and dotnet pack produces TinyAst.Preprocessor.0.1.0.nupkg.
  • Includes symbols (.snupkg) and generated XML documentation output (currently with CS1591 warnings for missing docs).

Compatibility

  • Target framework: .NET 8 (net8.0)
  • Depends on: TinyAst 0.11.0, TinyPreprocessor 0.3.0

Quality

  • Test suite: 76 tests passing (dotnet test green), including integration coverage of the full preprocessing pipeline.