@@ -38,8 +38,8 @@
3838 * BLOCK-END # Indentation decrease.
3939 * FLOW-SEQUENCE-START # '['
4040 * FLOW-SEQUENCE-END # ']'
41− * BLOCK-SEQUENCE-START # '{'
42− * BLOCK-SEQUENCE-END # '}'
41+ * FLOW-MAPPING-START # '{'
42+ * FLOW-MAPPING-END # '}'
4343 * BLOCK-ENTRY # '-'
4444 * FLOW-ENTRY # ','
4545 * KEY # '?' or nothing (simple keys).
@@ -1636,7 +1636,7 @@ yaml_parser_fetch_key(yaml_parser_t *parser)
16361636
16371637 if (!parser->flow_level)
16381638 {
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). */
16401640
16411641 if (!parser->simple_key_allowed) {
16421642 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,
28602860
28612861 if (!CACHE(parser, 1)) goto error;
28622862
2863− while ((int)parser->mark.column == indent && !IS_Z(parser->buffer))
2863+ while ((int)parser->mark.column == indent && !(IS_Z(parser->buffer)))
28642864 {
28652865 /*
28662866 * 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)
34303430
34313431 while (!IS_BLANKZ(parser->buffer))
34323432 {
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
3436+ */
34343437
34353438 if (parser->flow_level
34363439 && CHECK(parser->buffer, ':')
3437− && !IS_BLANKZ_AT(parser->buffer, 1)) {
3440+ && (
3441+ CHECK_AT(parser->buffer, ',', 1)
3442+ || CHECK_AT(parser->buffer, '?', 1)
3443+ || CHECK_AT(parser->buffer, '[', 1)
3444+ || CHECK_AT(parser->buffer, ']', 1)
3445+ || CHECK_AT(parser->buffer, '{', 1)
3446+ || CHECK_AT(parser->buffer, '}', 1)
3447+ )
3448+ ) {
34383449 yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
34393450 start_mark, "found unexpected ':'");
34403451 goto error;
@@ -3444,7 +3455,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
34443455
34453456 if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1))
34463457 || (parser->flow_level &&
3447− (CHECK(parser->buffer, ',') || CHECK(parser->buffer, ':')
3458+ (CHECK(parser->buffer, ',')
34483459 || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[')
34493460 || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
34503461 || CHECK(parser->buffer, '}'))))