int main()
{
- setbuf(stdout, NULL);
int r = yyparse();
yylex_destroy();
return r;
struct lambda *t = $1;
printf(" ");
for(unsigned int i = 0; i<999; i++)
- if(!lambda_reduce(&t, &t, true))
+ if(!lambda_reduce(&t, &t, false))
break;
lambda_print(t, NULL);
putchar('\n');
putchar('|');
switch(t->which){
case lambda_ident:
-// printf("%s(%p)", t->data.identifier.ident, (void *)t->data.identifier.binding);
printf("%s", t->data.identifier.ident);
break;
case lambda_abs:
term_print(t, mark);
break;
case lambda_app:
- if(t->data.application.expr1->which == lambda_abs)
- putchar('(');
+ putchar('(');
term_print(t->data.application.expr1, mark);
if(t->data.application.expr1->which == lambda_abs)
- putchar(')');
-
- putchar(' ');
-
- if(t->data.application.expr2->which == lambda_app)
- putchar('(');
+ printf(") (");
term_print(t->data.application.expr2, mark);
- if(t->data.application.expr2->which == lambda_app)
- putchar(')');
+ putchar(')');
break;
}
if(t == mark)