File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -983,11 +983,7 @@ impl Generator {
983983 return ;
984984 }
985985
986- add_line ! (
987- self ,
988- "static TSCharacterRange {}[] = {{" ,
989- info. constant_name
990- ) ;
986+ add_line ! ( self , "const TSCharacterRange {}[] = {{" , info. constant_name) ;
991987
992988 indent ! ( self ) ;
993989 for ( ix, range) in characters. ranges ( ) . enumerate ( ) {
Original file line number Diff line number Diff line change @@ -132,21 +132,21 @@ struct TSLanguage {
132132 const char * name ;
133133};
134134
135- static inline bool set_contains (TSCharacterRange * ranges , uint32_t len , int32_t lookahead ) {
135+ static inline bool set_contains (const TSCharacterRange * ranges , uint32_t len , int32_t lookahead ) {
136136 uint32_t index = 0 ;
137137 uint32_t size = len - index ;
138138 while (size > 1 ) {
139139 uint32_t half_size = size / 2 ;
140140 uint32_t mid_index = index + half_size ;
141- TSCharacterRange * range = & ranges [mid_index ];
141+ const TSCharacterRange * range = & ranges [mid_index ];
142142 if (lookahead >= range -> start && lookahead <= range -> end ) {
143143 return true;
144144 } else if (lookahead > range -> end ) {
145145 index = mid_index ;
146146 }
147147 size -= half_size ;
148148 }
149- TSCharacterRange * range = & ranges [index ];
149+ const TSCharacterRange * range = & ranges [index ];
150150 return (lookahead >= range -> start && lookahead <= range -> end );
151151}
152152
You can’t perform that action at this time.
0 commit comments