Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
SEXP: Process single hide tokens for schematics
Browse files Browse the repository at this point in the history
  • Loading branch information
mawildoer committed Sep 13, 2024
1 parent e666bf2 commit 0ef533c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/faebryk/libs/sexp/dataclass_sexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def _convert(
if val == []:
return None

assert False, f"Invalid value for bool: {val}"
# hide
if isinstance(val, bool):
return val

raise ValueError(f"Invalid value for bool: {val}")

if isinstance(val, Symbol):
return t(str(val))
Expand Down Expand Up @@ -181,6 +185,13 @@ def _decode[T](
if str(key) + "s" in key_fields or str(key) in key_fields:
ungrouped_key_values.append(val)
continue

# The only symbol this is currently used for is the hide symbol in schematics
if isinstance(val, Symbol):
if str(val) + "s" in key_fields or str(val) in key_fields:
ungrouped_key_values.append([val, True])
continue

unprocessed_indices.add(i)

key_values = groupby(
Expand Down

0 comments on commit 0ef533c

Please sign in to comment.