class Node { const Node( this.name, [ this.props = const {}, this.children = const [], ]); final String name; final Map props; final List children; @override String toString() => '($name${props.entries.map((e) => ' :${e.key} ${_q(e.value)}').join()}${children.map((c) => ' $c').join()})'; static String _q(Object? v) => switch (v) { null => 'nil', String v => '"$v"', List v => '(${v.map(_q).join(' ')})', Map v => '(${v.entries.map((e) => ':${e.key} ${_q(e.value)}').join(' ')})', _ => '$v', }; }