summaryrefslogtreecommitdiff
path: root/tests/example-deconstructor.c
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2007-01-07 20:11:16 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2007-01-07 20:11:16 +0000
commitdd329a85cdb65dde7ac4a5bc3d47ca25cbc2036a (patch)
treea99269e56362f968985551445cab0267c16d2aa9 /tests/example-deconstructor.c
parent07ebb0347fc9ff410b0b93c92f6ece52568d6991 (diff)
downloadlibyaml-dd329a85cdb65dde7ac4a5bc3d47ca25cbc2036a.tar.gz
Add functions for constructing, parsing and emitting YAML documents.
git-svn-id: http://svn.pyyaml.org/libyaml/trunk@238 18f92427-320e-0410-9341-c67f048884a3
Diffstat (limited to 'tests/example-deconstructor.c')
-rw-r--r--tests/example-deconstructor.c116
1 files changed, 58 insertions, 58 deletions
diff --git a/tests/example-deconstructor.c b/tests/example-deconstructor.c
index 57e6693..fec7d59 100644
--- a/tests/example-deconstructor.c
+++ b/tests/example-deconstructor.c
@@ -336,67 +336,67 @@ main(int argc, char *argv[])
tag != input_event.data.document_start.tag_directives.end;
tag ++)
{
- /* Write '{'. */
-
- if (!yaml_mapping_start_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:map", 1,
- YAML_FLOW_MAPPING_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write 'handle'. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str", "handle", -1,
- 1, 1, YAML_PLAIN_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write the tag directive handle. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str",
- tag->handle, -1,
- 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write 'prefix'. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str", "prefix", -1,
- 1, 1, YAML_PLAIN_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write the tag directive prefix. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str",
- tag->prefix, -1,
- 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write '}'. */
-
- if (!yaml_mapping_end_event_initialize(&output_event))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
- }
-
- /* End a block sequence. */
-
- if (!yaml_sequence_end_event_initialize(&output_event))
+ /* Write '{'. */
+
+ if (!yaml_mapping_start_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:map", 1,
+ YAML_FLOW_MAPPING_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write 'handle'. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str", "handle", -1,
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write the tag directive handle. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str",
+ tag->handle, -1,
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write 'prefix'. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str", "prefix", -1,
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
goto event_error;
if (!yaml_emitter_emit(&emitter, &output_event))
goto emitter_error;
+
+ /* Write the tag directive prefix. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str",
+ tag->prefix, -1,
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write '}'. */
+
+ if (!yaml_mapping_end_event_initialize(&output_event))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+ }
+
+ /* End a block sequence. */
+
+ if (!yaml_sequence_end_event_initialize(&output_event))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
}
/* Write 'implicit'. */