mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-05 08:56:16 +01:00
GVariant parser: tweak lexer for format strings
Tweak the lexer so that '[%s]' gets parsed as three separate tokens, instead of the closing bracket getting sucked into the format string.
This commit is contained in:
parent
1d87c6c7f8
commit
57cd876321
@ -223,10 +223,11 @@ token_stream_prepare (TokenStream *stream)
|
||||
case '@': case '%':
|
||||
/* stop at the first space, comma, colon or unmatched bracket.
|
||||
* deals nicely with cases like (%i, %i) or {%i: %i}.
|
||||
* Also: ] and > are never in format strings.
|
||||
*/
|
||||
for (end = stream->stream + 1;
|
||||
end != stream->end && *end != ',' &&
|
||||
*end != ':' && *end != '>' && !g_ascii_isspace (*end);
|
||||
*end != ':' && *end != '>' && *end != ']' && !g_ascii_isspace (*end);
|
||||
end++)
|
||||
|
||||
if (*end == '(' || *end == '{')
|
||||
|
Loading…
Reference in New Issue
Block a user