~cypheon/kicad2spice

ref: 96e390bc4f914314da98ecdfd7bd775e620563e2 kicad2spice/lib/sexp.ml -rw-r--r-- 241 bytes
96e390bc — Johann Rudloff Implement correct pin order according to field "Spice_Node_Sequence" 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
type t =
  | Sexp of (t * t list)
  | Atom of string

let quote_string s = "\"" ^ s ^ "\""

let rec show = function
  | Sexp (id, tail) -> "(" ^ (show id) ^ " " ^ (String.concat " " (List.map show tail)) ^ ")"
  | Atom s -> quote_string s