Author: fabien
Date: 2010-02-22 15:45:05 +0100 (Mon, 22 Feb 2010)
New Revision: 28186

Modified:
   branches/2.0/src/Symfony/Components/Yaml/Parser.php
   branches/2.0/tests/fixtures/Symfony/Components/Yaml/sfTests.yml
   branches/2.0/tests/unit/Symfony/Components/Yaml/DumperTest.php
   branches/2.0/tests/unit/Symfony/Components/Yaml/ParserTest.php
Log:
Merge branch 'master' of git://github.com/symfony/symfony

Modified: branches/2.0/src/Symfony/Components/Yaml/Parser.php
===================================================================
--- branches/2.0/src/Symfony/Components/Yaml/Parser.php 2010-02-22 14:28:40 UTC 
(rev 28185)
+++ branches/2.0/src/Symfony/Components/Yaml/Parser.php 2010-02-22 14:45:05 UTC 
(rev 28186)
@@ -189,7 +189,8 @@
       }
       else
       {
-        if (1 == count($this->lines))
+        // 1-liner followed by newline
+        if (2 == count($this->lines) && empty($this->lines[1]))
         {
           $value = Inline::load($this->lines[0]);
           if (is_array($value))
@@ -540,8 +541,10 @@
   {
     $value = str_replace(array("\r\n", "\r"), "\n", $value);
 
-    // remove trailing newlines
-    $value = rtrim($value, "\n");
+    if (!preg_match("#\n$#", $value))
+    {
+      $value .= "\n";
+    }
 
     // strip YAML header
     preg_replace('#^\%YAML[: ][\d\.]+.*\n#s', '', $value);

Modified: branches/2.0/tests/fixtures/Symfony/Components/Yaml/sfTests.yml
===================================================================
--- branches/2.0/tests/fixtures/Symfony/Components/Yaml/sfTests.yml     
2010-02-22 14:28:40 UTC (rev 28185)
+++ branches/2.0/tests/fixtures/Symfony/Components/Yaml/sfTests.yml     
2010-02-22 14:45:05 UTC (rev 28186)
@@ -13,6 +13,12 @@
 php: |
     array('foo' => array())
 ---
+test: Empty value
+yaml: |
+    foo:
+php: |
+    array('foo' => null)
+---
 test: Inline string parsing
 brief: >
     Inline string parsing

Modified: branches/2.0/tests/unit/Symfony/Components/Yaml/DumperTest.php
===================================================================
--- branches/2.0/tests/unit/Symfony/Components/Yaml/DumperTest.php      
2010-02-22 14:28:40 UTC (rev 28185)
+++ branches/2.0/tests/unit/Symfony/Components/Yaml/DumperTest.php      
2010-02-22 14:45:05 UTC (rev 28186)
@@ -16,7 +16,7 @@
 
 Yaml::setSpecVersion('1.1');
 
-$t = new LimeTest(148);
+$t = new LimeTest(149);
 
 $parser = new Parser();
 $dumper = new Dumper();

Modified: branches/2.0/tests/unit/Symfony/Components/Yaml/ParserTest.php
===================================================================
--- branches/2.0/tests/unit/Symfony/Components/Yaml/ParserTest.php      
2010-02-22 14:28:40 UTC (rev 28185)
+++ branches/2.0/tests/unit/Symfony/Components/Yaml/ParserTest.php      
2010-02-22 14:45:05 UTC (rev 28186)
@@ -16,7 +16,7 @@
 
 Yaml::setSpecVersion('1.1');
 
-$t = new LimeTest(148);
+$t = new LimeTest(149);
 
 $parser = new Parser();
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to