Skip to content

cvt_asm: Nested macro support (future enhancement) #235

Description

@CTalkobt

Deferred Feature: Nested Macro Support for cvt_asm

Status

DEFERRED - Low priority, no current demand. Will implement when:

  • A real-world use case with nested macros appears
  • User requests it with an actual file
  • Benefit-to-effort ratio improves

Current Behavior

Single-level macros fully supported:

  • ✓ Extract macro definitions
  • ✓ Preserve in macro-supporting formats
  • ✓ Expand for non-macro formats

Nested macros:

  • ✗ NOT supported (treated as macro body content)
  • Result: Nested structure is flattened, functionality preserved

Why Deferred

  1. Not used in practice - No evidence in 6502/65C02 assembly code
  2. Acceptable degradation - Files still convert correctly (just flattened)
  3. Implementation cost - ~200 lines of code + testing
  4. Better use of time - Prioritize features with actual demand

Implementation (When Needed)

Would require:

  • Nesting depth tracking (not just boolean flag)
  • Stack-based macro storage for nested levels
  • Parameter scoping per nesting level
  • Recursive expansion logic
  • Test suite for nested expansion

Related


Priority: LOW
Effort: MEDIUM
Demand: NONE (currently)
Status: FUTURE WORK

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    asmAssemblerenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions