Tree printer extension: allow arbitrary custom code in a rule