Changeset 238 for libyaml/trunk/src/emitter.c
- Timestamp:
- 01/07/07 15:11:16 (6 years ago)
- File:
-
- 1 edited
-
libyaml/trunk/src/emitter.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libyaml/trunk/src/emitter.c
r216 r238 1161 1161 { 1162 1162 yaml_scalar_style_t style = event->data.scalar.style; 1163 int no_tag = (!emitter->tag_data.handle && !emitter->tag_data.suffix); 1164 1165 if (no_tag && !event->data.scalar.plain_implicit 1166 && !event->data.scalar.quoted_implicit) { 1167 return yaml_emitter_set_emitter_error(emitter, 1168 "neither tag nor implicit flags are specified"); 1169 } 1163 1170 1164 1171 if (style == YAML_ANY_SCALAR_STYLE) … … 1179 1186 && (emitter->flow_level || emitter->simple_key_context)) 1180 1187 style = YAML_SINGLE_QUOTED_SCALAR_STYLE; 1181 if (!event->data.scalar.plain_implicit 1182 && !emitter->tag_data.handle && !emitter->tag_data.suffix) 1188 if (no_tag && !event->data.scalar.plain_implicit) 1183 1189 style = YAML_SINGLE_QUOTED_SCALAR_STYLE; 1184 1190 } … … 1197 1203 } 1198 1204 1199 if (!emitter->tag_data.handle && !emitter->tag_data.suffix) 1200 { 1201 if (!event->data.scalar.plain_implicit 1202 && !event->data.scalar.quoted_implicit) { 1203 return yaml_emitter_set_emitter_error(emitter, 1204 "neither tag nor implicit flags are specified"); 1205 } 1206 1207 if (event->data.scalar.plain_implicit 1208 && style != YAML_PLAIN_SCALAR_STYLE) { 1209 emitter->tag_data.handle = (yaml_char_t *)"!"; 1210 emitter->tag_data.handle_length = 1; 1211 } 1205 if (no_tag && !event->data.scalar.quoted_implicit 1206 && style != YAML_PLAIN_SCALAR_STYLE) 1207 { 1208 emitter->tag_data.handle = (yaml_char_t *)"!"; 1209 emitter->tag_data.handle_length = 1; 1212 1210 } 1213 1211
Note: See TracChangeset
for help on using the changeset viewer.
