Commit 57cd8763 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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.
parent 1d87c6c7
......@@ -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 == '{')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment