Skip to content

Added support for KiCad explicit net names containing "/" characters - #325

Merged
nunobrum merged 2 commits into
nunobrum:mainfrom
xdylanm:fix/kicad-net-name
Sep 20, 2026
Merged

nunobrum merged 2 commits into
nunobrum:mainfrom
xdylanm:fix/kicad-net-name

Conversation

@xdylanm

@xdylanm xdylanm commented Sep 11, 2026

Copy link
Copy Markdown

Modified the PREFIX_AND_NODES_RGX regex, fixes #324

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The regex update should be accompanied by a regression unit test, and the current character class has an unescaped - that unintentionally broadens the allowed node characters.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR updates the SPICE component parsing regex generator to accept KiCad explicit net names that include / characters (e.g. /Vout), addressing the UnrecognizedSyntaxError reported in issue #324.

Changes:

  • Extend PREFIX_AND_NODES_RGX node-name character classes to include / for both quoted (« ») and unquoted node lists.
File summaries
File Description
spicelib/editor/spice_utils.py Expands the node-token regex to allow / in net names so KiCad-style explicit net labels parse correctly.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread spicelib/editor/spice_utils.py Outdated
Comment thread spicelib/editor/spice_utils.py Outdated
@xdylanm

xdylanm commented Sep 15, 2026

Copy link
Copy Markdown
Author

After making the change to the regex, I've re-run the test suite locally. All pass, but many tests are skipped as I'm running on Linux. Ideally the full suite could be run before merging.

@nunobrum

Copy link
Copy Markdown
Owner

I'll make the test. Exceptionally I'll merge directly into main and make the correction there.

@nunobrum
nunobrum merged commit a7cf288 into nunobrum:main Sep 20, 2026
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.

SpiceEditor throws UnrecognizedSyntaxError when parsing a component containing a KiCad net name with leading "/"

3 participants