nooc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/nooc
Log | Files | Refs | LICENSE

commit 40880caeea40aa8fe056da6bad44f5992fe3ed58
parent e251e54a0a02f44dd5d5c48814965c97fc276c47
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Sun,  5 Dec 2021 17:48:15 -0600

disallow multiple declarations with same name in a block

Diffstat:
Mmain.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/main.c b/main.c @@ -404,6 +404,11 @@ parse(struct token **tok) expect(*tok, TOK_EQUAL); *tok = (*tok)->next; + // FIXME: scoping + if (finddecl(&items, decl.s)) { + error("repeat declaration!"); + } + decl.val = parseexpr(tok); array_add((&decls), decl);