Парсинг форматов KiCad через S-выражения на Zig
engineering
sexp is a Claude Code skill that explains how the Zig S-expression engine and typed KiCad models work and how they are exposed to Python via the pyzig_sexp extension module. The subsystem provides a fast Zig tokenizer, AST, and pretty-printer alongside typed models for KiCad formats — PCB, footprint, netlist, symbol, schematic, and fp_lib_table — wrapped by faebryk.libs.kicad.fileformats with path-based caching and loads/dumps helpers. Core source files include tokenizer.zig, ast.zig, structure.zig, and sexp_py.zig (which exports PyInit_pyzig_sexp); generated Python stubs live in gen/sexp/*.pyi. The skill covers critical memory and lifetime invariants: Zig duplicates the input string into a persistent allocator, so repeated loads calls without matching free calls can grow heap usage. It applies whenever you work with KiCad file parsing, S-expression generation, or board layout sync through the exporters and layout_sync pipeline.
- #s-expressions
- #kicad
- #parsing
- #zig
- #file-formats
- #layout-sync