<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -104,6 +104,7 @@ static VALUE rb_cResolver;
 
 static ID id_plain;
 static ID id_quote2;
+static ID id_inline;
 
 static SEL sel_to_yaml;
 static SEL sel_call;
@@ -527,6 +528,32 @@ rb_symbol_to_scalar_style(VALUE sym)
     return style;
 }
 
+static yaml_scalar_style_t
+rb_symbol_to_sequence_style(VALUE sym)
+{
+    yaml_sequence_style_t style = YAML_ANY_SEQUENCE_STYLE;
+    if (NIL_P(sym)) {
+	return style;
+    }
+    else if (rb_to_id(sym) == id_inline) {
+	style = YAML_FLOW_SEQUENCE_STYLE;
+    }
+    return style;
+}
+
+static yaml_scalar_style_t
+rb_symbol_to_mapping_style(VALUE sym)
+{
+    yaml_mapping_style_t style = YAML_ANY_MAPPING_STYLE;
+    if (NIL_P(sym)) {
+	return style;
+    }
+    else if (rb_to_id(sym) == id_inline) {
+	style = YAML_FLOW_MAPPING_STYLE;
+    }
+    return style;
+}
+
 static yaml_char_t*
 rb_yaml_tag_or_null(VALUE tagstr, int *can_omit_tag)
 {
@@ -663,7 +690,7 @@ rb_yaml_emitter_sequence(VALUE self, SEL sel, VALUE taguri, VALUE style)
     int can_omit_tag = 0;
     yaml_char_t *tag = rb_yaml_tag_or_null(taguri, &amp;can_omit_tag);
     yaml_sequence_start_event_initialize(&amp;ev, NULL, tag, can_omit_tag,
-	    YAML_ANY_SEQUENCE_STYLE);
+	    rb_symbol_to_sequence_style(style));
     yaml_emitter_emit(emitter, &amp;ev);
 
     rb_yield(self);
@@ -682,7 +709,7 @@ rb_yaml_emitter_mapping(VALUE self, SEL sel, VALUE taguri, VALUE style)
     int can_omit_tag = 0;
     yaml_char_t *tag = rb_yaml_tag_or_null(taguri, &amp;can_omit_tag);
     yaml_mapping_start_event_initialize(&amp;ev, NULL, tag, can_omit_tag,
-	    YAML_ANY_MAPPING_STYLE);
+	    rb_symbol_to_mapping_style(style));
     yaml_emitter_emit(emitter, &amp;ev);
 
     rb_yield(self);
@@ -775,6 +802,7 @@ Init_libyaml()
 {
     id_plain = rb_intern(&quot;plain&quot;);
     id_quote2 = rb_intern(&quot;quote2&quot;);
+    id_inline = rb_intern(&quot;inline&quot;);
 
     sel_to_yaml = sel_registerName(&quot;to_yaml:&quot;);
     sel_call = sel_registerName(&quot;call:&quot;);</diff>
      <filename>ext/libyaml/rubyext.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f39c75334701fc1f2cb644f8890079fd2aaf78ca</id>
    </parent>
  </parents>
  <author>
    <name>lsansonetti@apple.com</name>
    <email>lsansonetti@apple.com@23306eb0-4c56-4727-a40e-e92c0eb68959</email>
  </author>
  <url>http://github.com/dj2/MacRuby/commit/0f54590e0340435ad0f751c4a7f71b5ae5a5fe19</url>
  <id>0f54590e0340435ad0f751c4a7f71b5ae5a5fe19</id>
  <committed-date>2009-10-12T22:58:35-07:00</committed-date>
  <authored-date>2009-10-12T22:58:35-07:00</authored-date>
  <message>implement :inline format for YAML sequences and mappings (patch by Matthias Neeracher)

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@2787 23306eb0-4c56-4727-a40e-e92c0eb68959</message>
  <tree>5e33448044b006f00010b2fd5b133a348d8aa4fc</tree>
  <committer>
    <name>lsansonetti@apple.com</name>
    <email>lsansonetti@apple.com@23306eb0-4c56-4727-a40e-e92c0eb68959</email>
  </committer>
</commit>
