Correctness release: fixes all 60 findings from a systematic multi-agent audit, each reproduced and adversarially verified against the formatter binary (and gfortran, for compile-safety).
Continuation handling (reader rewritten around a string-state-aware scanner)
- F2018 6.3.2.4 splicing: split string literals (
'abc&'/'&def') and split identifiers reassemble exactly; no more space injection that corrupted literals and broke tokens & !conversion,!&stripping, and comment detection no longer fire inside continued character literals- Plain comments inside continuations are hoisted and the statement resumes with or without a leading
&(matches gfortran);& ! commentstill terminates and repairs the dangling& !$omp/!$accsentinels inside continuations are preserved verbatim instead of absorbed or deleted
Directives & comments
- Long
!$acc/!$omp/!DIR$lines are never rewrapped into inert comments - unicode-to-ascii now applies to inline trailing comments; emails no longer split as doxygen commands; doxygen joining respects
rewrap-commentsand range mode ! ffmt offregions are byte-verbatim (cleaning passes excluded) and the scope tracker stays in sync through them
Classifier/indentation: pure module function, type::name, parameterized-derived-type prefixes, named else, labeled do/statements, block data, and endif = 3-style identifiers all classify correctly.
Normalization & post-passes: UTF-8 passes through untouched (was mojibaked byte-by-byte, compounding per run); keyword-case = "upper" implemented (was a no-op); doubled-quote '' escapes handled in all scanners; blank-line management is classifier-driven; use ... only: reformatting preserves comments; split-statements re-indents and is idempotent; declaration-blank ordering fixed.
CLI/LSP/config: --range/LSP range formatting no longer rewrites lines outside the range; LSP end-position exclusivity fixed; --diff emits valid unified hunks (patch/git apply clean); config resolved per-file as documented; unknown config keys are a loud error instead of silently discarding the config; the .ffmt_cache is invalidated across versions/config changes.
377 tests; full MFC differential sweep is repair-only and idempotent.