Skip to content

Fix #331#341

Merged
kzkn merged 3 commits into
masterfrom
fix-331
May 28, 2026
Merged

Fix #331#341
kzkn merged 3 commits into
masterfrom
fix-331

Conversation

@kzkn
Copy link
Copy Markdown
Member

@kzkn kzkn commented Feb 8, 2025

ref: #331

@kzkn kzkn added the work in progress Not ready for merging yet. label Feb 8, 2025
kzkn added 2 commits May 28, 2026 20:49
A kwarg without a default value (e.g. `def foo a:`) followed by a
newline-and-body had its trailing newline eaten by `skip_space_or_newline`
in visit_params. With no newline left, indent_body folded the body onto
the same line, producing syntactically invalid output like
`def foo a: ...body... end`.

Skip only spaces when the label has no default value; the consume_space
path already handles space+newline for the value-bearing case.

Fixes #331
The spec relies on shorthand hash literal `{ uid: }`, which is Ruby 3.1+
syntax, so it cannot be parsed on Ruby 3.0. Move it under 3.1/ so it is
only loaded on supported versions.
@kzkn kzkn merged commit d22dfc2 into master May 28, 2026
6 checks passed
@kzkn kzkn deleted the fix-331 branch May 28, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work in progress Not ready for merging yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant