@@ -143,7 +143,7 @@ void parser_advance_no_gap(parserstate *state) {
143143 | {(tUIDENT `::`)*} <tXIDENT>
144144 | {<tXIDENT>}
145145*/
146- VALUE parse_type_name (parserstate * state , TypeNameKind kind , range * rg ) {
146+ static VALUE parse_type_name (parserstate * state , TypeNameKind kind , range * rg ) {
147147 VALUE absolute = Qfalse ;
148148 VALUE path = EMPTY_ARRAY ;
149149 VALUE namespace ;
@@ -757,7 +757,7 @@ static void check_key_duplication(parserstate *state, VALUE fields, VALUE key) {
757757 record_attribute ::= {} keyword_token `:` <type>
758758 | {} literal_type `=>` <type>
759759*/
760- VALUE parse_record_attributes (parserstate * state ) {
760+ static VALUE parse_record_attributes (parserstate * state ) {
761761 VALUE fields = rb_hash_new ();
762762
763763 if (state -> next_token .type == pRBRACE ) {
@@ -1123,7 +1123,7 @@ VALUE parse_type(parserstate *state) {
11231123
11241124 type_param ::= tUIDENT upper_bound? default_type? (module_type_params == false)
11251125*/
1126- VALUE parse_type_params (parserstate * state , range * rg , bool module_type_params ) {
1126+ static VALUE parse_type_params (parserstate * state , range * rg , bool module_type_params ) {
11271127 VALUE params = EMPTY_ARRAY ;
11281128
11291129 bool required_param_allowed = true;
@@ -1295,7 +1295,7 @@ VALUE parse_method_type(parserstate *state) {
12951295/*
12961296 global_decl ::= {tGIDENT} `:` <type>
12971297*/
1298- VALUE parse_global_decl (parserstate * state ) {
1298+ static VALUE parse_global_decl (parserstate * state ) {
12991299 range decl_range ;
13001300 range name_range , colon_range ;
13011301
@@ -1330,7 +1330,7 @@ VALUE parse_global_decl(parserstate *state) {
13301330/*
13311331 const_decl ::= {const_name} `:` <type>
13321332*/
1333- VALUE parse_const_decl (parserstate * state ) {
1333+ static VALUE parse_const_decl (parserstate * state ) {
13341334 range decl_range ;
13351335 range name_range , colon_range ;
13361336
@@ -1364,7 +1364,7 @@ VALUE parse_const_decl(parserstate *state) {
13641364/*
13651365 type_decl ::= {kTYPE} alias_name `=` <type>
13661366*/
1367- VALUE parse_type_decl (parserstate * state , position comment_pos , VALUE annotations ) {
1367+ static VALUE parse_type_decl (parserstate * state , position comment_pos , VALUE annotations ) {
13681368 range decl_range ;
13691369 range keyword_range , name_range , params_range , eq_range ;
13701370
@@ -1409,7 +1409,7 @@ VALUE parse_type_decl(parserstate *state, position comment_pos, VALUE annotation
14091409/*
14101410 annotation ::= {<tANNOTATION>}
14111411*/
1412- VALUE parse_annotation (parserstate * state ) {
1412+ static VALUE parse_annotation (parserstate * state ) {
14131413 VALUE content = rb_funcall (state -> buffer , rb_intern ("content" ), 0 );
14141414 rb_encoding * enc = rb_enc_get (content );
14151415
@@ -1465,7 +1465,7 @@ VALUE parse_annotation(parserstate *state) {
14651465 annotations ::= {} annotation ... <annotation>
14661466 | {<>}
14671467*/
1468- void parse_annotations (parserstate * state , VALUE * annotations , position * annot_pos ) {
1468+ static void parse_annotations (parserstate * state , VALUE * annotations , position * annot_pos ) {
14691469 * annot_pos = NullPosition ;
14701470
14711471 while (true) {
@@ -1488,7 +1488,7 @@ void parse_annotations(parserstate *state, VALUE *annotations, position *annot_p
14881488 method_name ::= {} <IDENT | keyword>
14891489 | {} (IDENT | keyword)~<`?`>
14901490*/
1491- VALUE parse_method_name (parserstate * state , range * range ) {
1491+ static VALUE parse_method_name (parserstate * state , range * range ) {
14921492 parser_advance (state );
14931493
14941494 switch (state -> current_token .type )
@@ -1556,7 +1556,7 @@ typedef enum {
15561556
15571557 @param allow_selfq `true` to accept `self?` kind.
15581558*/
1559- InstanceSingletonKind parse_instance_singleton_kind (parserstate * state , bool allow_selfq , range * rg ) {
1559+ static InstanceSingletonKind parse_instance_singleton_kind (parserstate * state , bool allow_selfq , range * rg ) {
15601560 InstanceSingletonKind kind = INSTANCE_KIND ;
15611561
15621562 if (state -> next_token .type == kSELF ) {
@@ -1599,7 +1599,7 @@ InstanceSingletonKind parse_instance_singleton_kind(parserstate *state, bool all
15991599 * @param instance_only `true` to reject singleton method definition.
16001600 * @param accept_overload `true` to accept overloading (...) definition.
16011601 * */
1602- VALUE parse_member_def (parserstate * state , bool instance_only , bool accept_overload , position comment_pos , VALUE annotations ) {
1602+ static VALUE parse_member_def (parserstate * state , bool instance_only , bool accept_overload , position comment_pos , VALUE annotations ) {
16031603 range member_range ;
16041604 range visibility_range ;
16051605 range keyword_range ;
@@ -1779,7 +1779,7 @@ void class_instance_name(parserstate *state, TypeNameKind kind, VALUE *name, VAL
17791779 *
17801780 * @param from_interface `true` when the member is in an interface.
17811781 * */
1782- VALUE parse_mixin_member (parserstate * state , bool from_interface , position comment_pos , VALUE annotations ) {
1782+ static VALUE parse_mixin_member (parserstate * state , bool from_interface , position comment_pos , VALUE annotations ) {
17831783 range member_range ;
17841784 range name_range ;
17851785 range keyword_range ;
@@ -1861,7 +1861,7 @@ VALUE parse_mixin_member(parserstate *state, bool from_interface, position comme
18611861 *
18621862 * @param[in] instance_only `true` to reject `self.` alias.
18631863 * */
1864- VALUE parse_alias_member (parserstate * state , bool instance_only , position comment_pos , VALUE annotations ) {
1864+ static VALUE parse_alias_member (parserstate * state , bool instance_only , position comment_pos , VALUE annotations ) {
18651865 range member_range ;
18661866 range keyword_range , new_name_range , old_name_range ;
18671867 range new_kind_range , old_kind_range ;
@@ -1924,7 +1924,7 @@ VALUE parse_alias_member(parserstate *state, bool instance_only, position commen
19241924 | {kSELF} `.` tAIDENT `:` <type>
19251925 | {tA2IDENT} `:` <type>
19261926*/
1927- VALUE parse_variable_member (parserstate * state , position comment_pos , VALUE annotations ) {
1927+ static VALUE parse_variable_member (parserstate * state , position comment_pos , VALUE annotations ) {
19281928 range member_range ;
19291929 range name_range , colon_range ;
19301930 range kind_range = NULL_RANGE ;
@@ -2024,7 +2024,7 @@ VALUE parse_variable_member(parserstate *state, position comment_pos, VALUE anno
20242024 visibility_member ::= {<`public`>}
20252025 | {<`private`>}
20262026*/
2027- VALUE parse_visibility_member (parserstate * state , VALUE annotations ) {
2027+ static VALUE parse_visibility_member (parserstate * state , VALUE annotations ) {
20282028 if (rb_array_len (annotations ) > 0 ) {
20292029 raise_syntax_error (
20302030 state ,
@@ -2060,7 +2060,7 @@ VALUE parse_visibility_member(parserstate *state, VALUE annotations) {
20602060 | `(` tAIDENT `)` # Ivar name
20612061 | `(` `)` # No variable
20622062*/
2063- VALUE parse_attribute_member (parserstate * state , position comment_pos , VALUE annotations ) {
2063+ static VALUE parse_attribute_member (parserstate * state , position comment_pos , VALUE annotations ) {
20642064 range member_range ;
20652065 range keyword_range , name_range , colon_range ;
20662066 range kind_range = NULL_RANGE , ivar_range = NULL_RANGE , ivar_name_range = NULL_RANGE , visibility_range = NULL_RANGE ;
@@ -2166,7 +2166,7 @@ VALUE parse_attribute_member(parserstate *state, position comment_pos, VALUE ann
21662166 | mixin_member (interface only)
21672167 | alias_member (instance only)
21682168*/
2169- VALUE parse_interface_members (parserstate * state ) {
2169+ static VALUE parse_interface_members (parserstate * state ) {
21702170 VALUE members = EMPTY_ARRAY ;
21712171
21722172 while (state -> next_token .type != kEND ) {
@@ -2211,7 +2211,7 @@ VALUE parse_interface_members(parserstate *state) {
22112211/*
22122212 interface_decl ::= {`interface`} interface_name module_type_params interface_members <kEND>
22132213*/
2214- VALUE parse_interface_decl (parserstate * state , position comment_pos , VALUE annotations ) {
2214+ static VALUE parse_interface_decl (parserstate * state , position comment_pos , VALUE annotations ) {
22152215 range member_range ;
22162216 range name_range , keyword_range , end_range ;
22172217 range type_params_range = NULL_RANGE ;
@@ -2258,7 +2258,7 @@ VALUE parse_interface_decl(parserstate *state, position comment_pos, VALUE annot
22582258 module_self_type ::= <module_name>
22592259 | module_name `[` type_list <`]`>
22602260*/
2261- void parse_module_self_types (parserstate * state , VALUE * array ) {
2261+ static void parse_module_self_types (parserstate * state , VALUE * array ) {
22622262 while (true) {
22632263 range self_range ;
22642264 range name_range ;
@@ -2298,7 +2298,7 @@ void parse_module_self_types(parserstate *state, VALUE *array) {
22982298 }
22992299}
23002300
2301- VALUE parse_nested_decl (parserstate * state , const char * nested_in , position annot_pos , VALUE annotations );
2301+ static VALUE parse_nested_decl (parserstate * state , const char * nested_in , position annot_pos , VALUE annotations );
23022302
23032303/*
23042304 module_members ::= {} ...<module_member> kEND
@@ -2311,7 +2311,7 @@ VALUE parse_nested_decl(parserstate *state, const char *nested_in, position anno
23112311 | `public`
23122312 | `private`
23132313*/
2314- VALUE parse_module_members (parserstate * state ) {
2314+ static VALUE parse_module_members (parserstate * state ) {
23152315 VALUE members = EMPTY_ARRAY ;
23162316
23172317 while (state -> next_token .type != kEND ) {
@@ -2388,7 +2388,7 @@ VALUE parse_module_members(parserstate *state) {
23882388 module_decl ::= {module_name} module_type_params module_members <kEND>
23892389 | {module_name} module_name module_type_params `:` module_self_types module_members <kEND>
23902390*/
2391- VALUE parse_module_decl0 (parserstate * state , range keyword_range , VALUE module_name , range name_range , VALUE comment , VALUE annotations ) {
2391+ static VALUE parse_module_decl0 (parserstate * state , range keyword_range , VALUE module_name , range name_range , VALUE comment , VALUE annotations ) {
23922392 range decl_range ;
23932393 range end_range ;
23942394 range type_params_range ;
@@ -2447,7 +2447,7 @@ VALUE parse_module_decl0(parserstate *state, range keyword_range, VALUE module_n
24472447 | {`module`} module_name module_decl0 <kEND>
24482448
24492449*/
2450- VALUE parse_module_decl (parserstate * state , position comment_pos , VALUE annotations ) {
2450+ static VALUE parse_module_decl (parserstate * state , position comment_pos , VALUE annotations ) {
24512451 range keyword_range = state -> current_token .range ;
24522452 range module_name_range ;
24532453
@@ -2487,7 +2487,7 @@ VALUE parse_module_decl(parserstate *state, position comment_pos, VALUE annotati
24872487 class_decl_super ::= {} `<` <class_instance_name>
24882488 | {<>}
24892489*/
2490- VALUE parse_class_decl_super (parserstate * state , range * lt_range ) {
2490+ static VALUE parse_class_decl_super (parserstate * state , range * lt_range ) {
24912491 if (parser_advance_if (state , pLT )) {
24922492 range super_range ;
24932493 range name_range ;
@@ -2522,7 +2522,7 @@ VALUE parse_class_decl_super(parserstate *state, range *lt_range) {
25222522/*
25232523 class_decl ::= {class_name} type_params class_decl_super class_members <`end`>
25242524*/
2525- VALUE parse_class_decl0 (parserstate * state , range keyword_range , VALUE name , range name_range , VALUE comment , VALUE annotations ) {
2525+ static VALUE parse_class_decl0 (parserstate * state , range keyword_range , VALUE name , range name_range , VALUE comment , VALUE annotations ) {
25262526 range decl_range ;
25272527 range end_range ;
25282528 range type_params_range ;
@@ -2573,7 +2573,7 @@ VALUE parse_class_decl0(parserstate *state, range keyword_range, VALUE name, ran
25732573 class_decl ::= {`class`} class_name `=` <class_name>
25742574 | {`class`} class_name <class_decl0>
25752575*/
2576- VALUE parse_class_decl (parserstate * state , position comment_pos , VALUE annotations ) {
2576+ static VALUE parse_class_decl (parserstate * state , position comment_pos , VALUE annotations ) {
25772577 range keyword_range = state -> current_token .range ;
25782578 range class_name_range ;
25792579
@@ -2616,7 +2616,7 @@ VALUE parse_class_decl(parserstate *state, position comment_pos, VALUE annotatio
26162616 | {<module_decl>}
26172617 | {<class_decl>}
26182618*/
2619- VALUE parse_nested_decl (parserstate * state , const char * nested_in , position annot_pos , VALUE annotations ) {
2619+ static VALUE parse_nested_decl (parserstate * state , const char * nested_in , position annot_pos , VALUE annotations ) {
26202620 VALUE decl ;
26212621
26222622 parser_push_typevar_table (state , true);
@@ -2654,7 +2654,7 @@ VALUE parse_nested_decl(parserstate *state, const char *nested_in, position anno
26542654 return decl ;
26552655}
26562656
2657- VALUE parse_decl (parserstate * state ) {
2657+ static VALUE parse_decl (parserstate * state ) {
26582658 VALUE annotations = EMPTY_ARRAY ;
26592659 position annot_pos = NullPosition ;
26602660
@@ -2688,7 +2688,7 @@ VALUE parse_decl(parserstate *state) {
26882688 namespace ::= {} (`::`)? (`tUIDENT` `::`)* `tUIDENT` <`::`>
26892689 | {} <> (empty -- returns empty namespace)
26902690*/
2691- VALUE parse_namespace (parserstate * state , range * rg ) {
2691+ static VALUE parse_namespace (parserstate * state , range * rg ) {
26922692 bool is_absolute = false;
26932693
26942694 if (state -> next_token .type == pCOLON2 ) {
@@ -2726,7 +2726,7 @@ VALUE parse_namespace(parserstate *state, range *rg) {
27262726 | {} namespace tUIDENT `as` <tUIDENT>
27272727 | {} namespace <tSTAR>
27282728*/
2729- void parse_use_clauses (parserstate * state , VALUE clauses ) {
2729+ static void parse_use_clauses (parserstate * state , VALUE clauses ) {
27302730 while (true) {
27312731 range namespace_range = NULL_RANGE ;
27322732 VALUE namespace = parse_namespace (state , & namespace_range );
@@ -2819,7 +2819,7 @@ void parse_use_clauses(parserstate *state, VALUE clauses) {
28192819/*
28202820 use_directive ::= {} `use` <clauses>
28212821 */
2822- VALUE parse_use_directive (parserstate * state ) {
2822+ static VALUE parse_use_directive (parserstate * state ) {
28232823 if (state -> next_token .type == kUSE ) {
28242824 parser_advance (state );
28252825
0 commit comments