@@ -35,7 +35,7 @@ s_reset(stack *s)
3535#define s_empty (s ) ((s)->s_top == &(s)->s_base[MAXSTACK])
3636
3737static int
38- s_push (stack * s , dfa * d , node * parent )
38+ s_push (stack * s , const dfa * d , node * parent )
3939{
4040 stackentry * top ;
4141 if (s -> s_top == s -> s_base ) {
@@ -119,7 +119,7 @@ shift(stack *s, int type, char *str, int newstate, int lineno, int col_offset,
119119}
120120
121121static int
122- push (stack * s , int type , dfa * d , int newstate , int lineno , int col_offset ,
122+ push (stack * s , int type , const dfa * d , int newstate , int lineno , int col_offset ,
123123 int end_lineno , int end_col_offset )
124124{
125125 int err ;
@@ -144,7 +144,7 @@ classify(parser_state *ps, int type, const char *str)
144144 int n = g -> g_ll .ll_nlabels ;
145145
146146 if (type == NAME ) {
147- label * l = g -> g_ll .ll_label ;
147+ const label * l = g -> g_ll .ll_label ;
148148 int i ;
149149 for (i = n ; i > 0 ; i -- , l ++ ) {
150150 if (l -> lb_type != NAME || l -> lb_str == NULL ||
@@ -168,7 +168,7 @@ classify(parser_state *ps, int type, const char *str)
168168 }
169169
170170 {
171- label * l = g -> g_ll .ll_label ;
171+ const label * l = g -> g_ll .ll_label ;
172172 int i ;
173173 for (i = n ; i > 0 ; i -- , l ++ ) {
174174 if (l -> lb_type == type && l -> lb_str == NULL ) {
@@ -246,7 +246,7 @@ PyParser_AddToken(parser_state *ps, int type, char *str,
246246 /* Loop until the token is shifted or an error occurred */
247247 for (;;) {
248248 /* Fetch the current dfa and state */
249- dfa * d = ps -> p_stack .s_top -> s_dfa ;
249+ const dfa * d = ps -> p_stack .s_top -> s_dfa ;
250250 state * s = & d -> d_state [ps -> p_stack .s_top -> s_state ];
251251
252252 D (printf (" DFA '%s', state %d:" ,
@@ -260,15 +260,14 @@ PyParser_AddToken(parser_state *ps, int type, char *str,
260260 /* Push non-terminal */
261261 int nt = (x >> 8 ) + NT_OFFSET ;
262262 int arrow = x & ((1 <<7 )- 1 );
263- dfa * d1 ;
264263 if (nt == func_body_suite && !(ps -> p_flags & PyCF_TYPE_COMMENTS )) {
265264 /* When parsing type comments is not requested,
266265 we can provide better errors about bad indentation
267266 by using 'suite' for the body of a funcdef */
268267 D (printf (" [switch func_body_suite to suite]" ));
269268 nt = suite ;
270269 }
271- d1 = PyGrammar_FindDFA (
270+ const dfa * d1 = PyGrammar_FindDFA (
272271 ps -> p_grammar , nt );
273272 if ((err = push (& ps -> p_stack , nt , d1 ,
274273 arrow , lineno , col_offset ,
0 commit comments