Skip to content

Commit eb52204

Browse files
committed
Format parser.c
1 parent d4d60ac commit eb52204

1 file changed

Lines changed: 64 additions & 65 deletions

File tree

src/parser.c

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,39 @@
6161
/* nop */
6262

6363
#define PARAM_NAME_CASES \
64-
case kBOOL:\
65-
case kBOT: \
66-
case kCLASS: \
67-
case kFALSE: \
68-
case kINSTANCE: \
69-
case kINTERFACE: \
70-
case kNIL: \
71-
case kSELF: \
72-
case kSINGLETON: \
73-
case kTOP: \
74-
case kTRUE: \
75-
case kVOID: \
76-
case kTYPE: \
77-
case kUNCHECKED: \
78-
case kIN: \
79-
case kOUT: \
80-
case kEND: \
81-
case kDEF: \
82-
case kINCLUDE: \
83-
case kEXTEND: \
84-
case kPREPEND: \
85-
case kALIAS: \
86-
case kMODULE: \
87-
case kATTRREADER: \
88-
case kATTRWRITER: \
89-
case kATTRACCESSOR: \
90-
case kPUBLIC: \
91-
case kPRIVATE: \
92-
case kUNTYPED: \
93-
case kUSE: \
94-
case kAS: \
95-
case k__TODO__: \
96-
/* nop */
64+
case kBOOL: \
65+
case kBOT: \
66+
case kCLASS: \
67+
case kFALSE: \
68+
case kINSTANCE: \
69+
case kINTERFACE: \
70+
case kNIL: \
71+
case kSELF: \
72+
case kSINGLETON: \
73+
case kTOP: \
74+
case kTRUE: \
75+
case kVOID: \
76+
case kTYPE: \
77+
case kUNCHECKED: \
78+
case kIN: \
79+
case kOUT: \
80+
case kEND: \
81+
case kDEF: \
82+
case kINCLUDE: \
83+
case kEXTEND: \
84+
case kPREPEND: \
85+
case kALIAS: \
86+
case kMODULE: \
87+
case kATTRREADER: \
88+
case kATTRWRITER: \
89+
case kATTRACCESSOR: \
90+
case kPUBLIC: \
91+
case kPRIVATE: \
92+
case kUNTYPED: \
93+
case kUSE: \
94+
case kAS: \
95+
case k__TODO__: \
96+
/* nop */
9797

9898
#define CHECK_PARSE(call) \
9999
if (!call) { \
@@ -3672,42 +3672,42 @@ static bool parse_inline_comment(rbs_parser_t *parser, rbs_location_range *comme
36723672

36733673
NODISCARD
36743674
static bool parse_inline_param_type_annotation(rbs_parser_t *parser, rbs_ast_ruby_annotations_t **annotation, rbs_range_t rbs_range) {
3675-
rbs_parser_advance(parser);
3675+
rbs_parser_advance(parser);
36763676

3677-
rbs_location_range name_loc = rbs_location_range_current_token(parser);
3677+
rbs_location_range name_loc = rbs_location_range_current_token(parser);
36783678

3679-
ADVANCE_ASSERT(parser, pCOLON);
3679+
ADVANCE_ASSERT(parser, pCOLON);
36803680

3681-
rbs_location_range colon_loc = rbs_location_range_current_token(parser);
3681+
rbs_location_range colon_loc = rbs_location_range_current_token(parser);
36823682

3683-
rbs_node_t *param_type = NULL;
3684-
if (!rbs_parse_type(parser, &param_type, false, true, true)) {
3685-
return false;
3686-
}
3683+
rbs_node_t *param_type = NULL;
3684+
if (!rbs_parse_type(parser, &param_type, false, true, true)) {
3685+
return false;
3686+
}
36873687

3688-
rbs_location_range comment_loc = RBS_LOCATION_NULL_RANGE;
3689-
if (!parse_inline_comment(parser, &comment_loc)) {
3690-
return false;
3691-
}
3688+
rbs_location_range comment_loc = RBS_LOCATION_NULL_RANGE;
3689+
if (!parse_inline_comment(parser, &comment_loc)) {
3690+
return false;
3691+
}
36923692

3693-
rbs_location_range full_loc = {
3694-
.start_char = rbs_range.start.char_pos,
3695-
.start_byte = rbs_range.start.byte_pos,
3696-
.end_char = parser->current_token.range.end.char_pos,
3697-
.end_byte = parser->current_token.range.end.byte_pos,
3698-
};
3693+
rbs_location_range full_loc = {
3694+
.start_char = rbs_range.start.char_pos,
3695+
.start_byte = rbs_range.start.byte_pos,
3696+
.end_char = parser->current_token.range.end.char_pos,
3697+
.end_byte = parser->current_token.range.end.byte_pos,
3698+
};
36993699

3700-
*annotation = (rbs_ast_ruby_annotations_t *) rbs_ast_ruby_annotations_param_type_annotation_new(
3701-
ALLOCATOR(),
3702-
full_loc,
3703-
RBS_RANGE_LEX2AST(rbs_range),
3704-
name_loc,
3705-
colon_loc,
3706-
param_type,
3707-
comment_loc
3708-
);
3700+
*annotation = (rbs_ast_ruby_annotations_t *) rbs_ast_ruby_annotations_param_type_annotation_new(
3701+
ALLOCATOR(),
3702+
full_loc,
3703+
RBS_RANGE_LEX2AST(rbs_range),
3704+
name_loc,
3705+
colon_loc,
3706+
param_type,
3707+
comment_loc
3708+
);
37093709

3710-
return true;
3710+
return true;
37113711
}
37123712

37133713
NODISCARD
@@ -3911,10 +3911,9 @@ static bool parse_inline_leading_annotation(rbs_parser_t *parser, rbs_ast_ruby_a
39113911
return true;
39123912
}
39133913
case tLIDENT:
3914-
PARAM_NAME_CASES
3915-
{
3916-
return parse_inline_param_type_annotation(parser, annotation, rbs_range);
3917-
}
3914+
PARAM_NAME_CASES {
3915+
return parse_inline_param_type_annotation(parser, annotation, rbs_range);
3916+
}
39183917
default: {
39193918
rbs_parser_set_error(parser, parser->next_token, true, "unexpected token for @rbs annotation");
39203919
return false;

0 commit comments

Comments
 (0)