From d31f9ba65586887ac662a86887a8ffe87774081b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 10 Oct 2025 00:14:50 +0900 Subject: refactor: use |= operator to simplify code --- src/parse.c | 4 +--- src/preprocess.c | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/parse.c b/src/parse.c index 1ad11bd..39bd8f2 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1005,9 +1005,7 @@ static AstNode* parse_parameter_type_list(Parser* p) { --params->node_len; break; } - // TODO: |= is not supported - // has_void |= params->node_items[i].ty->kind == TypeKind_void; - has_void = has_void | (params->node_items[i].ty->kind == TypeKind_void); + has_void |= params->node_items[i].ty->kind == TypeKind_void; } if (params->node_len > 6) { diff --git a/src/preprocess.c b/src/preprocess.c index d3c662b..9605f69 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -825,10 +825,7 @@ static bool preprocess_elif_groups_opt(Preprocessor* pp, bool did_include) { Token* tok = peek_pp_token(pp); if (tok->kind == TokenKind_pp_directive_elif || tok->kind == TokenKind_pp_directive_elifdef || tok->kind == TokenKind_pp_directive_elifndef) { - // TODO: | and |= is not supported - // did_include |= preprocess_elif_group(pp, pp->pos, did_include); - bool a = preprocess_elif_group(pp, did_include); - did_include = did_include ? true : a; + did_include |= preprocess_elif_group(pp, did_include); } else { break; } -- cgit v1.2.3-70-g09d2