ref: 2a75839b66139c8e402fe6e40992b0fd3c9b01c8
parent: 5bf79c58e3124fa34d04403e0558b5a2ee9233c9
author: Ori Bernstein <[email protected]>
date: Fri Jul 20 15:29:27 EDT 2012
Whitespace.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -14,27 +14,29 @@
typedef struct Inferstate Inferstate;
struct Inferstate {
- int inpattern;
- int ingeneric;
+ /* what sort of constructs we're inside. incremented when we enter,
+ * decremented when we leave, in order to allow nesting */
+ int inpat;
+ int ingeneric;
- /* bound by patterns turn into decls in the action block */
- Node **binds;
- size_t nbinds;
- /* nodes that need post-inference checking/unification */
- Node **postcheck;
- size_t npostcheck;
- /* the type parmas bound at the current point */
- Htab **tybindings;
- size_t ntybindings;
- /* generic declarations to be specialized */
- Node **genericdecls;
- size_t ngenericdecls;
- /* the nodes that we've specialized them to, and the scopes they
- * appear in */
- Node **specializations;
- size_t nspecializations;
- Stab **specializationscope;
- size_t nspecializationscope;
+ /* bound by patterns turn into decls in the action block */
+ Node **binds;
+ size_t nbinds;
+ /* nodes that need post-inference checking/unification */
+ Node **postcheck;
+ size_t npostcheck;
+ /* the type parmas bound at the current point */
+ Htab **tybindings;
+ size_t ntybindings;
+ /* generic declarations to be specialized */
+ Node **genericdecls;
+ size_t ngenericdecls;
+ /* the nodes that we've specialized them to, and the scopes they
+ * appear in */
+ Node **specializations;
+ size_t nspecializations;
+ Stab **specializationscope;
+ size_t nspecializationscope;
};
static void infernode(Inferstate *st, Node *n, Type *ret, int *sawret);
@@ -737,7 +739,9 @@
}
break;
case Nmatch:
+ st->inpat++;
infernode(st, n->match.pat, NULL, sawret);
+ st->inpat--;
infernode(st, n->match.block, ret, sawret);
break;
case Nexpr: