To easily debug the structure and capture AST structure, you can use the StringDumperVisitor visitor.
use TypeLang\Parser\Traverser;
$visitor = new Traverser\StringDumperVisitor();
Traverser::new([$visitor])
->traverse([$result]);
echo $visitor->getOutput();