#define PUT(emitter,value) \
(FLUSH(emitter) \
&& (*(emitter->buffer.pointer++) = (yaml_char_t)(value), \
- emitter->column ++, \
+ emitter->column++, \
1))
/*
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- char *indicator, int need_whitespace,
+ const char *indicator, int need_whitespace,
int is_whitespace, int is_indention);
static int
if (emitter->best_width < 0) {
emitter->best_width = INT_MAX;
}
-
+
if (!emitter->line_break) {
emitter->line_break = YAML_LN_BREAK;
}
if (!yaml_emitter_write_indent(emitter))
return 0;
}
-
+
if (event->data.document_start.tag_directives.start
!= event->data.document_start.tag_directives.end) {
implicit = 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;
}
/*
- *
+ *
* Expect a flow item node.
*/
*/
static int
-yaml_emitter_emit_alias(yaml_emitter_t *emitter, yaml_event_t *event)
+yaml_emitter_emit_alias(yaml_emitter_t *emitter, SHIM(yaml_event_t *event))
{
if (!yaml_emitter_process_anchor(emitter))
return 0;
*/
static int
-yaml_emitter_check_empty_document(yaml_emitter_t *emitter)
+yaml_emitter_check_empty_document(SHIM(yaml_emitter_t *emitter))
{
return 0;
}
break;
case YAML_MAPPING_START_EVENT:
- if (!yaml_emitter_check_empty_sequence(emitter))
+ if (!yaml_emitter_check_empty_mapping(emitter))
return 0;
length += emitter->anchor_data.anchor_length
+ emitter->tag_data.handle_length
{
size_t anchor_length;
yaml_string_t string;
-
+
anchor_length = strlen((char *)anchor);
STRING_ASSIGN(string, anchor, anchor_length);
int break_space = 0;
int space_break = 0;
- int preceeded_by_whitespace = 0;
+ int preceded_by_whitespace = 0;
int followed_by_whitespace = 0;
int previous_space = 0;
int previous_break = 0;
flow_indicators = 1;
}
- preceeded_by_whitespace = 1;
+ preceded_by_whitespace = 1;
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
while (string.pointer != string.end)
}
}
- if (CHECK(string, '#') && preceeded_by_whitespace) {
+ if (CHECK(string, '#') && preceded_by_whitespace) {
flow_indicators = 1;
block_indicators = 1;
}
previous_break = 0;
}
- preceeded_by_whitespace = IS_BLANKZ(string);
+ preceded_by_whitespace = IS_BLANKZ(string);
MOVE(string);
if (string.pointer != string.end) {
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- char *indicator, int need_whitespace,
+ const char *indicator, int need_whitespace,
int is_whitespace, int is_indention)
{
size_t indicator_length;
}
}
+ if (breaks)
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+
if (!yaml_emitter_write_indicator(emitter, "'", 0, 0, 0))
return 0;
yaml_string_t string)
{
char indent_hint[2];
- char *chomp_hint = NULL;
+ const char *chomp_hint = NULL;
if (IS_SPACE(string) || IS_BREAK(string))
{
return 1;
}
-