Skip to content

Commit a9e7702

Browse files
st0012amomchilov
andauthored
Update src/parser.c
Co-authored-by: Alexander Momchilov <[email protected]>
1 parent 0a8a4c5 commit a9e7702

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parser.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,15 +3529,15 @@ static bool parse_inline_method_overloads(rbs_parser_t *parser, rbs_node_list_t
35293529

35303530
NODISCARD
35313531
static bool parse_inline_comment(rbs_parser_t *parser, rbs_location_t **comment) {
3532-
if (parser->next_token.type == tINLINECOMMENT) {
3533-
rbs_range_t comment_range = parser->next_token.range;
3534-
rbs_parser_advance(parser);
3535-
3536-
*comment = rbs_location_new(ALLOCATOR(), comment_range);
3532+
if (parser->next_token.type != tINLINECOMMENT) {
3533+
*comment = NULL;
35373534
return true;
35383535
}
35393536

3540-
*comment = NULL;
3537+
rbs_range_t comment_range = parser->next_token.range;
3538+
rbs_parser_advance(parser);
3539+
3540+
*comment = rbs_location_new(ALLOCATOR(), comment_range);
35413541
return true;
35423542
}
35433543

0 commit comments

Comments
 (0)