aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-11 17:03:03 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-11 17:03:03 -0400
commitfb2d7b5379663e929ffabfbd8428de5b35ad67c4 (patch)
treec0fdd8d373053cc907c4c18fe12156c400fb09da /parse.c
parent888a977132a8494a512d5f1539fc35f464da40a2 (diff)
Add extern structs
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index ed8d041b..81b239a5 100644
--- a/parse.c
+++ b/parse.c
@@ -2111,12 +2111,14 @@ PARSER(parse_struct_def) {
arg_ast_t *fields = parse_args(ctx, &pos);
whitespace(&pos);
- bool secret = false;
+ bool secret = false, external = false;
if (match(&pos, ";")) { // Extra flags
whitespace(&pos);
for (;;) {
if (match_word(&pos, "secret"))
secret = true;
+ else if (match_word(&pos, "extern"))
+ external = true;
else
break;
@@ -2139,7 +2141,8 @@ PARSER(parse_struct_def) {
}
if (!namespace)
namespace = NewAST(ctx->file, pos, pos, Block, .statements=NULL);
- return NewAST(ctx->file, start, pos, StructDef, .name=name, .fields=fields, .namespace=namespace, .secret=secret);
+ return NewAST(ctx->file, start, pos, StructDef, .name=name, .fields=fields, .namespace=namespace,
+ .secret=secret, .external=external);
}
PARSER(parse_enum_def) {