mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.
Notably, it seems some people didn't absorb the style rules of
commit c9d297751
, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
This commit is contained in:
@ -54,7 +54,7 @@ typedef enum /* contexts of JSON parser */
|
||||
|
||||
static inline JsonParseErrorType json_lex_string(JsonLexContext *lex);
|
||||
static inline JsonParseErrorType json_lex_number(JsonLexContext *lex, char *s,
|
||||
bool *num_err, int *total_len);
|
||||
bool *num_err, int *total_len);
|
||||
static inline JsonParseErrorType parse_scalar(JsonLexContext *lex, JsonSemAction *sem);
|
||||
static JsonParseErrorType parse_object_field(JsonLexContext *lex, JsonSemAction *sem);
|
||||
static JsonParseErrorType parse_object(JsonLexContext *lex, JsonSemAction *sem);
|
||||
@ -179,7 +179,7 @@ JsonParseErrorType
|
||||
pg_parse_json(JsonLexContext *lex, JsonSemAction *sem)
|
||||
{
|
||||
JsonTokenType tok;
|
||||
JsonParseErrorType result;
|
||||
JsonParseErrorType result;
|
||||
|
||||
/* get the initial token */
|
||||
result = json_lex(lex);
|
||||
@ -198,7 +198,7 @@ pg_parse_json(JsonLexContext *lex, JsonSemAction *sem)
|
||||
result = parse_array(lex, sem);
|
||||
break;
|
||||
default:
|
||||
result = parse_scalar(lex, sem); /* json can be a bare scalar */
|
||||
result = parse_scalar(lex, sem); /* json can be a bare scalar */
|
||||
}
|
||||
|
||||
if (result == JSON_SUCCESS)
|
||||
@ -220,7 +220,7 @@ json_count_array_elements(JsonLexContext *lex, int *elements)
|
||||
{
|
||||
JsonLexContext copylex;
|
||||
int count;
|
||||
JsonParseErrorType result;
|
||||
JsonParseErrorType result;
|
||||
|
||||
/*
|
||||
* It's safe to do this with a shallow copy because the lexical routines
|
||||
@ -252,7 +252,7 @@ json_count_array_elements(JsonLexContext *lex, int *elements)
|
||||
}
|
||||
}
|
||||
result = lex_expect(JSON_PARSE_ARRAY_NEXT, ©lex,
|
||||
JSON_TOKEN_ARRAY_END);
|
||||
JSON_TOKEN_ARRAY_END);
|
||||
if (result != JSON_SUCCESS)
|
||||
return result;
|
||||
|
||||
@ -527,7 +527,7 @@ json_lex(JsonLexContext *lex)
|
||||
{
|
||||
char *s;
|
||||
int len;
|
||||
JsonParseErrorType result;
|
||||
JsonParseErrorType result;
|
||||
|
||||
/* Skip leading whitespace. */
|
||||
s = lex->token_terminator;
|
||||
@ -1123,8 +1123,8 @@ json_errdetail(JsonParseErrorType error, JsonLexContext *lex)
|
||||
static char *
|
||||
extract_token(JsonLexContext *lex)
|
||||
{
|
||||
int toklen = lex->token_terminator - lex->token_start;
|
||||
char *token = palloc(toklen + 1);
|
||||
int toklen = lex->token_terminator - lex->token_start;
|
||||
char *token = palloc(toklen + 1);
|
||||
|
||||
memcpy(token, lex->token_start, toklen);
|
||||
token[toklen] = '\0';
|
||||
|
Reference in New Issue
Block a user