@@ -38,8 +38,8 @@
38 * BLOCK-END # Indentation decrease.
38 * BLOCK-END # Indentation decrease.
39 * FLOW-SEQUENCE-START # '['
39 * FLOW-SEQUENCE-START # '['
40 * FLOW-SEQUENCE-END # ']'
40 * FLOW-SEQUENCE-END # ']'
41− * BLOCK-SEQUENCE-START # '{'
41+ * FLOW-MAPPING-START # '{'
42− * BLOCK-SEQUENCE-END # '}'
42+ * FLOW-MAPPING-END # '}'
43 * BLOCK-ENTRY # '-'
43 * BLOCK-ENTRY # '-'
44 * FLOW-ENTRY # ','
44 * FLOW-ENTRY # ','
45 * KEY # '?' or nothing (simple keys).
45 * KEY # '?' or nothing (simple keys).
@@ -1636,7 +1636,7 @@ yaml_parser_fetch_key(yaml_parser_t *parser)
1637 if (!parser->flow_level)
1637 if (!parser->flow_level)
1639− /* Check if we are allowed to start a new key (not nessesary simple). */
1639+ /* Check if we are allowed to start a new key (not necessary simple). */
1641 if (!parser->simple_key_allowed) {
1641 if (!parser->simple_key_allowed) {
1642 return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
1642 return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
@@ -2860,7 +2860,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
2861 if (!CACHE(parser, 1)) goto error;
2861 if (!CACHE(parser, 1)) goto error;
2863− while ((int)parser->mark.column == indent && !IS_Z(parser->buffer))
2863+ while ((int)parser->mark.column == indent && !(IS_Z(parser->buffer)))
2866 * We are at the beginning of a non-empty line.
2866 * We are at the beginning of a non-empty line.
@@ -3430,11 +3430,22 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
3431 while (!IS_BLANKZ(parser->buffer))
3431 while (!IS_BLANKZ(parser->buffer))
3433− /* Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". */
3433+ /* Check for "x:" + one of ',?[]{}' in the flow context. TODO: Fix the test "spec-08-13".
3434+ * This is not completely according to the spec
3435+ * See http://yaml.org/spec/1.1/#id907281 9.1.3. Plain
3435 if (parser->flow_level
3438 if (parser->flow_level
3436 && CHECK(parser->buffer, ':')
3439 && CHECK(parser->buffer, ':')
3441+ CHECK_AT(parser->buffer, ',', 1)
3442+ || CHECK_AT(parser->buffer, '?', 1)
3443+ || CHECK_AT(parser->buffer, '[', 1)
3437− && !IS_BLANKZ_AT(parser->buffer, 1)) {
3444+ || CHECK_AT(parser->buffer, ']', 1)
3445+ || CHECK_AT(parser->buffer, '{', 1)
3446+ || CHECK_AT(parser->buffer, '}', 1)
3438 yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
3449 yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
3439 start_mark, "found unexpected ':'");
3450 start_mark, "found unexpected ':'");
3440 goto error;
3451 goto error;
@@ -3444,7 +3455,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
3445 if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1))
3456 if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1))
3446 || (parser->flow_level &&
3457 || (parser->flow_level &&
3447− (CHECK(parser->buffer, ',') || CHECK(parser->buffer, ':')
3458+ (CHECK(parser->buffer, ',')
3448 || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[')
3459 || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[')
3449 || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
3460 || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
3450 || CHECK(parser->buffer, '}'))))
3461 || CHECK(parser->buffer, '}'))))