@@ -213,15 +213,15 @@ static char JSON_PROD_GOAL[] = {JSON_TOKEN_END, JSON_NT_JSON, 0};
213
213
static inline JsonParseErrorType json_lex_string (JsonLexContext * lex );
214
214
static inline JsonParseErrorType json_lex_number (JsonLexContext * lex , const char * s ,
215
215
bool * num_err , size_t * total_len );
216
- static inline JsonParseErrorType parse_scalar (JsonLexContext * lex , JsonSemAction * sem );
217
- static JsonParseErrorType parse_object_field (JsonLexContext * lex , JsonSemAction * sem );
218
- static JsonParseErrorType parse_object (JsonLexContext * lex , JsonSemAction * sem );
219
- static JsonParseErrorType parse_array_element (JsonLexContext * lex , JsonSemAction * sem );
220
- static JsonParseErrorType parse_array (JsonLexContext * lex , JsonSemAction * sem );
216
+ static inline JsonParseErrorType parse_scalar (JsonLexContext * lex , const JsonSemAction * sem );
217
+ static JsonParseErrorType parse_object_field (JsonLexContext * lex , const JsonSemAction * sem );
218
+ static JsonParseErrorType parse_object (JsonLexContext * lex , const JsonSemAction * sem );
219
+ static JsonParseErrorType parse_array_element (JsonLexContext * lex , const JsonSemAction * sem );
220
+ static JsonParseErrorType parse_array (JsonLexContext * lex , const JsonSemAction * sem );
221
221
static JsonParseErrorType report_parse_error (JsonParseContext ctx , JsonLexContext * lex );
222
222
223
223
/* the null action object used for pure validation */
224
- JsonSemAction nullSemAction =
224
+ const JsonSemAction nullSemAction =
225
225
{
226
226
NULL , NULL , NULL , NULL , NULL ,
227
227
NULL , NULL , NULL , NULL , NULL
@@ -519,7 +519,7 @@ freeJsonLexContext(JsonLexContext *lex)
519
519
* other differences.
520
520
*/
521
521
JsonParseErrorType
522
- pg_parse_json (JsonLexContext * lex , JsonSemAction * sem )
522
+ pg_parse_json (JsonLexContext * lex , const JsonSemAction * sem )
523
523
{
524
524
#ifdef FORCE_JSON_PSTACK
525
525
@@ -648,7 +648,7 @@ json_count_array_elements(JsonLexContext *lex, int *elements)
648
648
*/
649
649
JsonParseErrorType
650
650
pg_parse_json_incremental (JsonLexContext * lex ,
651
- JsonSemAction * sem ,
651
+ const JsonSemAction * sem ,
652
652
const char * json ,
653
653
size_t len ,
654
654
bool is_last )
@@ -1005,7 +1005,7 @@ pg_parse_json_incremental(JsonLexContext *lex,
1005
1005
* - object field
1006
1006
*/
1007
1007
static inline JsonParseErrorType
1008
- parse_scalar (JsonLexContext * lex , JsonSemAction * sem )
1008
+ parse_scalar (JsonLexContext * lex , const JsonSemAction * sem )
1009
1009
{
1010
1010
char * val = NULL ;
1011
1011
json_scalar_action sfunc = sem -> scalar ;
@@ -1049,7 +1049,7 @@ parse_scalar(JsonLexContext *lex, JsonSemAction *sem)
1049
1049
}
1050
1050
1051
1051
static JsonParseErrorType
1052
- parse_object_field (JsonLexContext * lex , JsonSemAction * sem )
1052
+ parse_object_field (JsonLexContext * lex , const JsonSemAction * sem )
1053
1053
{
1054
1054
/*
1055
1055
* An object field is "fieldname" : value where value can be a scalar,
@@ -1111,7 +1111,7 @@ parse_object_field(JsonLexContext *lex, JsonSemAction *sem)
1111
1111
}
1112
1112
1113
1113
static JsonParseErrorType
1114
- parse_object (JsonLexContext * lex , JsonSemAction * sem )
1114
+ parse_object (JsonLexContext * lex , const JsonSemAction * sem )
1115
1115
{
1116
1116
/*
1117
1117
* an object is a possibly empty sequence of object fields, separated by
@@ -1185,7 +1185,7 @@ parse_object(JsonLexContext *lex, JsonSemAction *sem)
1185
1185
}
1186
1186
1187
1187
static JsonParseErrorType
1188
- parse_array_element (JsonLexContext * lex , JsonSemAction * sem )
1188
+ parse_array_element (JsonLexContext * lex , const JsonSemAction * sem )
1189
1189
{
1190
1190
json_aelem_action astart = sem -> array_element_start ;
1191
1191
json_aelem_action aend = sem -> array_element_end ;
@@ -1229,7 +1229,7 @@ parse_array_element(JsonLexContext *lex, JsonSemAction *sem)
1229
1229
}
1230
1230
1231
1231
static JsonParseErrorType
1232
- parse_array (JsonLexContext * lex , JsonSemAction * sem )
1232
+ parse_array (JsonLexContext * lex , const JsonSemAction * sem )
1233
1233
{
1234
1234
/*
1235
1235
* an array is a possibly empty sequence of array elements, separated by
0 commit comments