shithub: mc

Download patch

ref: 8b40166d270adf9dacb384b24c22928379b1d225
parent: 29c18d7fc18d76827b14ce5de83e6c48330acfdc
author: Ori Bernstein <[email protected]>
date: Thu Jun 21 13:35:22 EDT 2012

Whitespace fixes.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -14,6 +14,9 @@
 
 static Node **postcheck;
 static size_t npostcheck;
+/* bound type schemes */
+static Htab **binds;
+static size_t nbinds;
 
 static void infernode(Node *n, Type *ret, int *sawret);
 static void inferexpr(Node *n, Type *ret, int *sawret);
@@ -140,9 +143,9 @@
 {
     char *s;
     switch (n->type) {
-        default:        s = nodestr(n->type); 	break;
-        case Ndecl:     s = declname(n); 	break;
-        case Nname:     s = namestr(n); 	break;
+        default:        s = nodestr(n->type);   break;
+        case Ndecl:     s = declname(n);        break;
+        case Nname:     s = namestr(n);         break;
         case Nexpr:
             if (exprop(n) == Ovar)
                 s = namestr(n->expr.args[0]);
@@ -490,15 +493,15 @@
              * need to patch the types in if they don't have a definition */
             inferstab(n->file.globls);
             inferstab(n->file.exports);
-	    for (i = 0; i < n->file.nstmts; i++) {
-		d  = n->file.stmts[i];
-		infernode(d, NULL, sawret);
-		if (d->type == Ndecl)  {
-		    s = getdcl(file->file.exports, d->decl.name);
-		    if (s)
-			unify(d, type(d), s->decl.type);
-		}
-	    }
+            for (i = 0; i < n->file.nstmts; i++) {
+                d  = n->file.stmts[i];
+                infernode(d, NULL, sawret);
+                if (d->type == Ndecl)  {
+                    s = getdcl(file->file.exports, d->decl.name);
+                    if (s)
+                        unify(d, type(d), s->decl.type);
+                }
+            }
             popstab();
             break;
         case Ndecl:
@@ -642,8 +645,8 @@
 
     k = htkeys(s->dcl, &n);
     for (i = 0; i < n; i++) {
-	d = getdcl(s, k[i]);
-	d->decl.type = tyfix(d->decl.name, d->decl.type);
+        d = getdcl(s, k[i]);
+        d->decl.type = tyfix(d->decl.name, d->decl.type);
     }
     free(k);
 }
@@ -657,8 +660,8 @@
     switch (n->type) {
         case Nfile:
             pushstab(n->file.globls);
-	    stabsub(n->file.globls);
-	    stabsub(n->file.exports);
+            stabsub(n->file.globls);
+            stabsub(n->file.exports);
             for (i = 0; i < n->file.nstmts; i++)
                 typesub(n->file.stmts[i]);
             popstab();