Repository navigation
feat: leading-ampersand option to drop the optional & on continuation lines - #17
Merged
Merged
Conversation
…ine as a continuation
sbryngelson
force-pushed
the
leading-ampersand-option
branch
from
October 17, 2026 19:55
9bb9e84 to
6d6b66f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
Adds an opt-in
leading-ampersandoption (defaulttrue, so existing output is unchanged). Withleading-ampersand = falsethe optional leading&is dropped from continuation lines and the alignment is kept:call s_foo(x, & y, z)It is a final pass, so every earlier pass still sees the canonical
&form. The&is kept where Fortran requires it (a continued character literal) and where dropping it would expose a#,!,$:or@:line to the parser.Checked on 335 real Fortran files: the only change between
trueandfalseis the removed&(14,807 lines), line counts are identical, and gfortran reports the same diagnostics for both outputs. Tests are intests/config_integration.rsplus a unit-test module insrc/formatter.rs(the string-literal guard is only reachable there, because ffmt rejoins split strings first). Documented indocs/configuration.md.cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testpass locally.Note: this touches
src/formatter.rsnear #16 and will conflict textually with it (adjacent helper functions). It is based on master, not stacked; I will rebase it after #16 merges.