ref: aaaf97aff4d5475e8cf636746c78bd25699d6049
parent: a5b54d2ac3f54b4a1ad3b736c7c599fff1607f79
author: Ori Bernstein <[email protected]>
date: Tue May 8 07:08:57 EDT 2012
Add declarations within a block to the stab
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -529,10 +529,14 @@
: stmt
{$$ = mkblock(line, mkstab());
if ($1)
- lappend(&$$->block.stmts, &$$->block.nstmts, $1);}
+ lappend(&$$->block.stmts, &$$->block.nstmts, $1);
+ if ($1->type == Ndecl)
+ putdcl($$->block.scope, $1->decl.sym);}
| blockbody stmt
{if ($2)
- lappend(&$$->block.stmts, &$$->block.nstmts, $2);}
+ lappend(&$$->block.stmts, &$$->block.nstmts, $2);
+ if ($1->type == Ndecl)
+ putdcl($$->block.scope, $1->decl.sym);}
;
label : TColon TIdent