Merge pull request #118 from thesamprice/fix/delete-label-all-types

fix: delete_label matches global_label and hierarchical_label types
This commit is contained in:
mixelpixx
2026-04-21 09:01:27 -04:00
committed by GitHub

View File

@@ -25,6 +25,8 @@ _SYM_PTS = Symbol("pts")
_SYM_XY = Symbol("xy")
_SYM_AT = Symbol("at")
_SYM_LABEL = Symbol("label")
_SYM_GLOBAL_LABEL = Symbol("global_label")
_SYM_HIERARCHICAL_LABEL = Symbol("hierarchical_label")
_SYM_STROKE = Symbol("stroke")
_SYM_WIDTH = Symbol("width")
_SYM_TYPE = Symbol("type")
@@ -681,8 +683,9 @@ class WireManager:
sch_data = sexpdata.loads(sch_content)
_LABEL_TYPES = {_SYM_LABEL, _SYM_GLOBAL_LABEL, _SYM_HIERARCHICAL_LABEL}
for i, item in enumerate(sch_data):
if not (isinstance(item, list) and len(item) > 0 and item[0] == _SYM_LABEL):
if not (isinstance(item, list) and len(item) > 0 and item[0] in _LABEL_TYPES):
continue
# Second element is the label text