MCPcopy Create free account
hub / github.com/apache/cloudberry / extract_token

Function extract_token

src/common/jsonapi.c:1125–1134  ·  view source on GitHub ↗

* Extract the current token from a lexing context, for error reporting. */

Source from the content-addressed store, hash-verified

1123 * Extract the current token from a lexing context, for error reporting.
1124 */
1125static char *
1126extract_token(JsonLexContext *lex)
1127{
1128 int toklen = lex->token_terminator - lex->token_start;
1129 char *token = palloc(toklen + 1);
1130
1131 memcpy(token, lex->token_start, toklen);
1132 token[toklen] = '\0';
1133 return token;
1134}

Callers 1

json_errdetailFunction · 0.85

Calls 1

pallocFunction · 0.70

Tested by

no test coverage detected