From 1008696708b56c27709e6948b419d44e0f1bfb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller=20=28tinita=29?= Date: Mon, 1 Jun 2020 21:28:43 +0200 Subject: 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. --- src/scanner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scanner.c b/src/scanner.c index 50d601a..c6b4987 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -3465,7 +3465,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token) 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; -- cgit v1.2.1