~ubuntu-branches/ubuntu/saucy/augeas/saucy-proposed

« back to all changes in this revision

Viewing changes to src/syntax.c

  • Committer: Package Import Robot
  • Author(s): Raphaël Pinson
  • Date: 2013-06-15 22:36:05 UTC
  • mfrom: (1.5.3)
  • Revision ID: package-import@ubuntu.com-20130615223605-en6kj1zzaku28c57
Tags: 1.1.0-0ubuntu1
* New upstream release
* Fix download URL in debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1465
1465
 
1466
1466
        /* Build lambda x: exp->right (exp->left x) as a closure */
1467
1467
        char *var = strdup("@0");
1468
 
        struct term *param = make_param(var, ref(exp->left->type->dom),
1469
 
                                        ref(info));
1470
 
        param->type = ref(exp->left->type);
 
1468
        struct term *func = make_param(var, ref(exp->left->type->dom),
 
1469
                                       ref(info));
 
1470
        func->type = make_arrow_type(exp->left->type->dom,
 
1471
                                     exp->right->type->img);
1471
1472
        struct term *ident = make_term(A_IDENT, ref(info));
1472
 
        ident->ident = ref(param->param->name);
1473
 
        ident->type = ref(param->type);
 
1473
        ident->ident = ref(func->param->name);
 
1474
        ident->type = ref(func->param->type);
1474
1475
        struct term *app = make_app_term(ref(exp->left), ident, ref(info));
1475
1476
        app->type = ref(app->left->type->img);
1476
1477
        app = make_app_term(ref(exp->right), app, ref(info));
1477
 
        app->type = ref(app->left->type->img);
 
1478
        app->type = ref(app->right->type->img);
1478
1479
 
1479
 
        struct term *func = build_func(param, app);
 
1480
        build_func(func, app);
1480
1481
 
1481
1482
        if (!type_equal(func->type, exp->type)) {
1482
1483
            char *f = type_string(func->type);
1965
1966
    struct term *term = NULL;
1966
1967
    int result = -1;
1967
1968
 
 
1969
    if (aug->flags & AUG_TRACE_MODULE_LOADING)
 
1970
        printf("Module %s", filename);
1968
1971
    augl_parse_file(aug, filename, &term);
 
1972
    if (aug->flags & AUG_TRACE_MODULE_LOADING)
 
1973
        printf(HAS_ERR(aug) ? " failed\n" : " loaded\n");
1969
1974
    ERR_BAIL(aug);
1970
1975
 
1971
1976
    if (! typecheck(term, aug))