Releases: dsisco11/TinyAst.Preprocessor
Releases · dsisco11/TinyAst.Preprocessor
Release list
v0.4.3
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
SyntaxTreeLineColumnMapperandSyntaxTreeLineBoundaryResolver, including strict contract checks (offsets are unique, strictly increasing, and within range).
v0.4.2
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
Release Notes — Diagnostics Line/Column + C#-Style Output
- Added line/column mapping for
SyntaxTreediagnostics usingIContentBoundaryResolver<SyntaxTree, LineBoundary>so locations can be reported as 1-basedline,column(and spans asline,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:columnoutput 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/columnoriented and more compiler-like).
v0.4
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
SyntaxTreesource-map boundary resolution. - Expanded test coverage for canonical
ResourceIdscenarios and redundant merge work prevention.
Breaking / Behavioral changes
- Merge identity is now resolver-authoritative:
ResourceIdis 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.
- Implemented
Improvements
- No redundant merge work (validated by tests):
- Shared dependencies and include-of-include graphs are processed exactly once per
ResourceId.
- Shared dependencies and include-of-include graphs are processed exactly once per
- Test instrumentation seam:
- Added a protected virtual
OnProcessResource(ResourceId)hook to observe per-resource processing in tests.
- Added a protected virtual
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
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+ImportDirectiveModelfor directive semantics and location modeling.ImportDirectiveParser<TImportNode>(delegate-based): configure withFunc<TImportNode, string?> getReference.SyntaxTreeMergeStrategy<TImportNode, TContext>(delegate-based): same reference extractor used during merge.SyntaxTreeContentModelimplementingIContentModel<SyntaxTree>.- Test helpers:
InMemorySyntaxTreeResourceStore,InMemorySyntaxTreeResourceResolver,ImportDirectiveLocationIndex. - Convenience wiring:
SyntaxTreePreprocessor<TImportNode, TContext>(one-stop preprocessor setup)SyntaxTreePreprocessor<TImportNode>(context defaults toobject)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
ResolutionFailedDiagnosticand can carry location/resource context.
Packaging
- NuGet packaging is configured and
dotnet packproducesTinyAst.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 testgreen), including integration coverage of the full preprocessing pipeline.