Skip to content

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.