# HG changeset patch # User Tina Müller (tinita) <cpan2@tinita.de> # Date 1591039723 -7200 # Mon Jun 01 21:28:43 2020 +0200 # Node ID c09fc69134da52ca290813534c27f8c95eca8979 # Parent dc53fae1805e077f618d199bed3e864bb0f3d36c Allow question marks in plain scalars in flow collections (#105) See http://yaml.org/spec/1.1/#id907281 The question mark isn't mentioned as something special here, only ,[]{} This commit will allow [foo?bar] [foo ? bar] The PR does only change the behaviour when the question mark is in the middle or at the end of the string, not at the beginning, e.g. [?foo] is handled by a different part of the code. diff --git a/src/scanner.c b/src/scanner.c --- a/src/scanner.c +++ b/src/scanner.c @@ -3465,7 +3465,7 @@ if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1)) || (parser->flow_level && (CHECK(parser->buffer, ',') - || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[') + || CHECK(parser->buffer, '[') || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{') || CHECK(parser->buffer, '}')))) break;