Skip to content

Commit

Permalink
colon can be in plain scalar, see PR #21
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Dec 3, 2016
1 parent e4fd039 commit 2a00a38
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -3431,21 +3431,11 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)

while (!IS_BLANKZ(parser->buffer))
{
/* Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". */

if (parser->flow_level
&& CHECK(parser->buffer, ':')
&& !IS_BLANKZ_AT(parser->buffer, 1)) {
yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
start_mark, "found unexpected ':'");
goto error;
}

/* Check for indicators that may end a plain scalar. */

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, '{')
|| CHECK(parser->buffer, '}'))))
Expand Down

0 comments on commit 2a00a38

Please sign in to comment.