From aa8b856aeb3e2aafd61486349fbb4f40899e682f Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Fri, 15 Dec 2006 10:38:41 +0000 Subject: [PATCH] some more fixes. Still some errors are left. --- include/block.h | 1 + src/block.c | 12 +++++++++--- src/statement.c | 4 ++-- src/stmtQueue.c | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/block.h b/include/block.h index 32f08d4..830aa5a 100644 --- a/include/block.h +++ b/include/block.h @@ -15,4 +15,5 @@ s_block * blockPrev (s_block *); s_stmtQueue * blockStmts (s_block *); s_identList * blockIdl (s_block *); +s_identList * blockGetIdl (s_block *); #endif /* _BLOCK_H_ */ diff --git a/src/block.c b/src/block.c index 38777dd..3bb7d13 100644 --- a/src/block.c +++ b/src/block.c @@ -1,8 +1,8 @@ +#include + #include #include -typedef struct block s_block; - struct block /* a stack of used blocks. */ { s_stmtQueue * stmts; @@ -12,6 +12,11 @@ struct block /* a stack of used blocks. */ }; +s_identList * +blockGetIdl (s_block * block) +{ + return block->idl; +} s_block * blockNew (s_stmtQueue * stmts) { @@ -19,7 +24,8 @@ blockNew (s_stmtQueue * stmts) new->stmts = stmts; new->prev = NULL; - new->idl = identListNew (new); + new->idl = identListNew (); /* !!!FIXME: i guess idl should know about + its block! (Give the block as arg) */ return new; } diff --git a/src/statement.c b/src/statement.c index d74c615..bb33d71 100644 --- a/src/statement.c +++ b/src/statement.c @@ -284,7 +284,7 @@ stmtBlock (s_stmt * stmt, s_block * actBlock) if (id == NULL) exitError (0); - blockSetNonLocalId (args, id); + blockSetNonLocalId (gBlock, id); } } @@ -309,7 +309,7 @@ stmtIf (s_stmt * stmt, s_block * actBlock) _do = stmtQueueGet (args, 2); if (_do != NULL) - stmtDo (_do); + stmtDo (_do, actBlock); return (u_stmtType) 0; } diff --git a/src/stmtQueue.c b/src/stmtQueue.c index 7b1250a..289d335 100644 --- a/src/stmtQueue.c +++ b/src/stmtQueue.c @@ -116,7 +116,7 @@ stmtQueueDo (s_stmtQueue * sQueue) return; for (i = 0; i < sQueue->maxIdx; i++) - stmtDo (sQueue->stmts[i]); + stmtDo (sQueue->stmts[i], NULL /* !!!FIXME: give me a sane value!!! */); } unsigned