term_print(t, mark);
break;
case lambda_app:
- putchar('(');
+ if(t->data.application.expr1->which == lambda_abs)
+ putchar('(');
term_print(t->data.application.expr1, mark);
if(t->data.application.expr1->which == lambda_abs)
- printf(") (");
+ putchar(')');
+
+ putchar(' ');
+
+ if(t->data.application.expr2->which == lambda_abs)
+ putchar('(');
term_print(t->data.application.expr2, mark);
- putchar(')');
+ if(t->data.application.expr2->which == lambda_abs)
+ putchar(')');
break;
}
if(t == mark)
void lambda_print(struct lambda *t, struct lambda *mark)
{
term_print(t, mark);
- printf("\n;");
+ putchar('\n');
}