Skip to content

fix: string parser now handles led and diode imperial sizes#610

Open
64johnlee wants to merge 3 commits into
tscircuit:mainfrom
64johnlee:fix/string-parser-led-diode
Open

fix: string parser now handles led and diode imperial sizes#610
64johnlee wants to merge 3 commits into
tscircuit:mainfrom
64johnlee:fix/string-parser-led-diode

Conversation

@64johnlee
Copy link
Copy Markdown

Summary

Fix Issue #562 - String parser fails for led and diode with imperial sizes.

Problem: The string parser does not correctly handle imperial/metric size codes for led and diode footprints. While res0402 and cap0603 work correctly, led0402 and diode0603 throw an error.

Root Cause: In src/footprinter.ts, the proxy handler only recognizes res and cap as passive footprints that use imperial/metric sizing.

Solution: Added led and diode to the list of passive footprints that use imperial sizing.

// Before
if (prop === "res" || prop === "cap") {

// After
if (prop === "res" || prop === "cap" || prop === "led" || prop === "diode") {

Testing

  • led0402 now correctly parses as { fn: "led", imperial: "0402" }
  • diode0603 now correctly parses as { fn: "diode", imperial: "0603" }

64johnlee added 3 commits April 29, 2026 01:02
Issue tscircuit#562 - String parser fails for led and diode with imperial sizes.

The fix adds 'led' and 'diode' to the list of passive footprints
that use imperial/metric sizing (alongside res and cap).
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