Skip to content

fix: handle Smoothie Board DSN pin number modifiers#122

Open
EnzoGaillardSystems wants to merge 1 commit intotscircuit:mainfrom
EnzoGaillardSystems:fix/smoothie-board-dsn
Open

fix: handle Smoothie Board DSN pin number modifiers#122
EnzoGaillardSystems wants to merge 1 commit intotscircuit:mainfrom
EnzoGaillardSystems:fix/smoothie-board-dsn

Conversation

@EnzoGaillardSystems
Copy link

/claim #54

Problem

Smoothie Board DSN files contain pin definitions with modifier lists like (rotate 90) at position 2 in the AST. The existing getPinNum always read position 2, so it grabbed the modifier list instead of the actual pin number, causing the conversion to fail.

Fix

  • Skip known modifier lists (rotate, mirror, flip) when extracting pin numbers
  • Only coerce to number when the string is fully numeric (preserves mixed identifiers like 2@1, GND1)
  • Walk AST nodes instead of hardcoding index 2

Changes

  • lib/utils/get-pin-number.ts — rewritten pin extraction logic

Closes #54

Skip rotate/mirror/flip modifier lists when extracting pin numbers.
Only coerce to number when string is fully numeric (preserves 2@1, GND1).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We can't convert Smoothie Board to Circuit JSON

1 participant