Skip to content

Add -C/--comment-column for inline comment alignment#4

Open
jamarju wants to merge 2 commits intoand3rson:mainfrom
jamarju:comment-column-alignment
Open

Add -C/--comment-column for inline comment alignment#4
jamarju wants to merge 2 commits intoand3rson:mainfrom
jamarju:comment-column-alignment

Conversation

@jamarju
Copy link
Copy Markdown

@jamarju jamarju commented Mar 10, 2026

Summary

  • Adds -C/--comment-column flag to control where inline (tail) comments are aligned (default: 24 for backward compatibility)
  • Fixes grammar so inline comments on constant_def and control_command lines are parsed separately and aligned like all other inline comments
  • Guarantees at least one space between code and comment even when the code exceeds the target column

Example

# Before (hardcoded column 24, equate comments not aligned):
human_color = $15            ; color the human is playing
scoreL_stack = $23            ; score stack low bytes

# After with -C 41:
human_color = $15                       ; color the human is playing
scoreL_stack = $23                      ; score stack low bytes
        lda #$a0                        ; PETSCII space character

Test plan

  • Verify default behavior unchanged (column 24)
  • Verify -C 41 aligns all inline comments at column 41
  • Verify comments on .byte, .word, .org and = lines are aligned
  • Verify at least 1 space of padding when code exceeds target column

🤖 Generated with Claude Code

Javi and others added 2 commits March 10, 2026 01:45
Adds a configurable column for aligning inline (tail) comments.
Default remains 24 for backward compatibility. Also fixes the grammar
so that inline comments on constant_def and control_command lines are
parsed separately and aligned consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests inline comment alignment on mnemonics, .byte, .org,
and constant definitions (equates).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant