diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-04 13:51:47 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-04 13:51:47 -0500 |
| commit | e29aa52460df6a5d3e78f7e466947bcdd7a3bbb0 (patch) | |
| tree | c0225e0db0d0e49e9ffe7e0e94e19ec067d98a8a /parse.c | |
| parent | 0b7ca098ae1dc5e31485bc505a441d3796f0702b (diff) | |
Struct and enum methods and static members
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1708,7 +1708,7 @@ PARSER(parse_func_def) { arg_ast_t *args = parse_args(ctx, &pos, false); whitespace(&pos); - bool is_inline = false; + bool is_inline = false, is_private = false; ast_t *cache_ast = NULL; for (bool specials = match(&pos, ";"); specials; specials = match_separator(&pos)) { const char *flag_start = pos; @@ -1721,6 +1721,8 @@ PARSER(parse_func_def) { parser_err(ctx, flag_start, pos, "I expected a value for 'cache_size'"); whitespace(&pos); cache_ast = expect(ctx, start, &pos, parse_expr, "I expected a maximum size for the cache"); + } else if (match_word(&pos, "private")) { + is_private = true; } } expect_closing(ctx, &pos, ")", "I wasn't able to parse the rest of this function definition"); @@ -1734,7 +1736,7 @@ PARSER(parse_func_def) { "This function needs a body block"); return NewAST(ctx->file, start, pos, FunctionDef, .name=name, .args=args, .ret_type=ret_type, .body=body, .cache=cache_ast, - .is_inline=is_inline); + .is_inline=is_inline, .is_private=is_private); } PARSER(parse_extern) { |
