fix ability to use previous generic params and
add error when `%return` shows up in a function with incorrect return type
This commit is contained in:
@@ -2605,7 +2605,7 @@ static AstNode *ast_parse_use(ParseContext *pc, int *token_index,
|
||||
|
||||
/*
|
||||
ContainerDecl = ("struct" | "enum" | "union") "Symbol" option(ParamDeclList) "{" many(StructMember) "}"
|
||||
StructMember = many(Directive) option(VisibleMod) (StructField | FnDef | GlobalVarDecl)
|
||||
StructMember = many(Directive) option(VisibleMod) (StructField | FnDef | GlobalVarDecl | ContainerDecl)
|
||||
StructField : "Symbol" option(":" Expression) ",")
|
||||
*/
|
||||
static AstNode *ast_parse_container_decl(ParseContext *pc, int *token_index,
|
||||
@@ -2675,6 +2675,12 @@ static AstNode *ast_parse_container_decl(ParseContext *pc, int *token_index,
|
||||
continue;
|
||||
}
|
||||
|
||||
AstNode *container_decl_node = ast_parse_container_decl(pc, token_index, directive_list, visib_mod);
|
||||
if (container_decl_node) {
|
||||
node->data.struct_decl.decls.append(container_decl_node);
|
||||
continue;
|
||||
}
|
||||
|
||||
Token *token = &pc->tokens->at(*token_index);
|
||||
|
||||
if (token->id == TokenIdRBrace) {
|
||||
|
||||
Reference in New Issue
Block a user