7
7
#include "string_parser.h"
8
8
9
9
PyObject *
10
- _PyPegen_new_type_comment (Parser * p , char * s )
10
+ _PyPegen_new_type_comment (Parser * p , const char * s )
11
11
{
12
12
PyObject * res = PyUnicode_DecodeUTF8 (s , strlen (s ), NULL );
13
13
if (res == NULL ) {
@@ -26,7 +26,7 @@ _PyPegen_add_type_comment_to_arg(Parser *p, arg_ty a, Token *tc)
26
26
if (tc == NULL ) {
27
27
return a ;
28
28
}
29
- char * bytes = PyBytes_AsString (tc -> bytes );
29
+ const char * bytes = PyBytes_AsString (tc -> bytes );
30
30
if (bytes == NULL ) {
31
31
return NULL ;
32
32
}
@@ -66,7 +66,7 @@ _PyPegen_check_barry_as_flufl(Parser *p, Token* t) {
66
66
assert (t -> bytes != NULL );
67
67
assert (t -> type == NOTEQUAL );
68
68
69
- char * tok_str = PyBytes_AS_STRING (t -> bytes );
69
+ const char * tok_str = PyBytes_AS_STRING (t -> bytes );
70
70
if (p -> flags & PyPARSE_BARRY_AS_BDFL && strcmp (tok_str , "<>" ) != 0 ) {
71
71
RAISE_SYNTAX_ERROR ("with Barry as BDFL, use '<>' instead of '!='" );
72
72
return -1 ;
@@ -78,7 +78,7 @@ _PyPegen_check_barry_as_flufl(Parser *p, Token* t) {
78
78
}
79
79
80
80
PyObject *
81
- _PyPegen_new_identifier (Parser * p , char * n )
81
+ _PyPegen_new_identifier (Parser * p , const char * n )
82
82
{
83
83
PyObject * id = PyUnicode_DecodeUTF8 (n , strlen (n ), NULL );
84
84
if (!id ) {
@@ -911,7 +911,7 @@ _PyPegen_expect_soft_keyword(Parser *p, const char *keyword)
911
911
if (t -> type != NAME ) {
912
912
return NULL ;
913
913
}
914
- char * s = PyBytes_AsString (t -> bytes );
914
+ const char * s = PyBytes_AsString (t -> bytes );
915
915
if (!s ) {
916
916
p -> error_indicator = 1 ;
917
917
return NULL ;
@@ -942,7 +942,7 @@ _PyPegen_name_from_token(Parser *p, Token* t)
942
942
if (t == NULL ) {
943
943
return NULL ;
944
944
}
945
- char * s = PyBytes_AsString (t -> bytes );
945
+ const char * s = PyBytes_AsString (t -> bytes );
946
946
if (!s ) {
947
947
p -> error_indicator = 1 ;
948
948
return NULL ;
@@ -1068,7 +1068,7 @@ _PyPegen_number_token(Parser *p)
1068
1068
return NULL ;
1069
1069
}
1070
1070
1071
- char * num_raw = PyBytes_AsString (t -> bytes );
1071
+ const char * num_raw = PyBytes_AsString (t -> bytes );
1072
1072
if (num_raw == NULL ) {
1073
1073
p -> error_indicator = 1 ;
1074
1074
return NULL ;
0 commit comments