implicit = 0;
}
+ if ((event->data.document_start.version_directive ||
+ (event->data.document_start.tag_directives.start
+ != event->data.document_start.tag_directives.end)) &&
+ emitter->open_ended)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
if (event->data.document_start.version_directive) {
implicit = 0;
if (!yaml_emitter_write_indicator(emitter, "%YAML", 1, 0, 0))
else if (event->type == YAML_STREAM_END_EVENT)
{
+ if (emitter->open_ended)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
if (!yaml_emitter_flush(emitter))
return 0;
emitter->whitespace = is_whitespace;
emitter->indention = (emitter->indention && is_indention);
+ emitter->open_ended = 0;
return 1;
}
emitter->whitespace = 0;
emitter->indention = 0;
+ if (emitter->root_context)
+ {
+ emitter->open_ended = 1;
+ }
return 1;
}
return 0;
}
+ emitter->open_ended = 0;
+
string.pointer = string.end;
if (string.start == string.pointer)
{
else if (string.start == string.pointer)
{
chomp_hint = "+";
+ emitter->open_ended = 1;
}
else
{
if (IS_BREAK(string))
{
chomp_hint = "+";
+ emitter->open_ended = 1;
}
}
}
while (IS_BREAK_AT(string, k)) {
k += WIDTH_AT(string, k);
}
- if (!IS_BLANK_AT(string, k)) {
+ if (!IS_BLANKZ_AT(string, k)) {
if (!PUT_BREAK(emitter)) return 0;
}
}