From: Brendan Hansen Date: Wed, 5 Oct 2022 00:20:34 +0000 (-0500) Subject: forgot to make "#auto" work with compound declarations X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=40c0933619b9fb6f1cc3f9422edf9e4b5094af11;p=onyx.git forgot to make "#auto" work with compound declarations --- diff --git a/compiler/src/parser.c b/compiler/src/parser.c index 8c878f61..4d1ed888 100644 --- a/compiler/src/parser.c +++ b/compiler/src/parser.c @@ -1299,7 +1299,13 @@ static i32 parse_possible_compound_symbol_declaration(OnyxParser* parser, AstNod prev_local->next = (AstNode *) assignment; } else { - AstType* type_for_all = parse_type(parser); + AstType* type_for_all = NULL; + + // See comment in parse_possible_symbol_declaration about "#auto" + if (!parse_possible_directive(parser, "auto")) { + type_for_all = parse_type(parser); + } + forll (AstLocal, local, first_local, next) { local->type_node = type_for_all; }