We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14daf4a commit a7bef9eCopy full SHA for a7bef9e
src/common/jsonapi.c
@@ -72,6 +72,22 @@ lex_peek(JsonLexContext *lex)
72
return lex->token_type;
73
}
74
75
+static inline char *
76
+lex_peek_value(JsonLexContext *lex)
77
+{
78
+ if (lex->token_type == JSON_TOKEN_STRING)
79
+ return lex->strval ? pstrdup(lex->strval->data) : NULL;
80
+ else
81
+ {
82
+ int len = (lex->token_terminator - lex->token_start);
83
+ char *tokstr = palloc(len + 1);
84
+
85
+ memcpy(tokstr, lex->token_start, len);
86
+ tokstr[len] = '\0';
87
+ return tokstr;
88
+ }
89
+}
90
91
/*
92
* lex_expect
93
*
0 commit comments