Development

Changeset 8489

You must first sign up to be able to contribute.

Changeset 8489

Show
Ignore:
Timestamp:
04/17/08 00:25:29 (5 months ago)
Author:
fabien
Message:

fixed embedded mapping in sequence bug in YAML parser

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/yaml/sfYamlParser.class.php

    r8410 r8489  
    8686        else 
    8787        { 
    88           $data[] = $this->parseValue($values['value']); 
     88          if (preg_match('/^([^ ]+)\: +({.*?)$/', $values['value'], $matches)) 
     89          { 
     90            $data[$matches[1]] = sfYamlInline::load($matches[2]); 
     91          } 
     92          else 
     93          { 
     94            $data[] = $this->parseValue($values['value']); 
     95          } 
    8996        } 
    9097      } 
  • branches/1.1/test/unit/yaml/fixtures/sfTests.yml

    r8286 r8489  
    8383php: | 
    8484  array('foo' => '10.0.0.2') 
     85--- 
     86test: A sequence with an embedded mapping 
     87brief: >  
     88  A sequence with an embedded mapping 
     89yaml: | 
     90  - foo 
     91  - bar: { bar: foo } 
     92php: | 
     93  array('foo', 'bar' => array('bar' => 'foo')) 
  • branches/1.1/test/unit/yaml/sfYamlDumperTest.php

    r8286 r8489  
    1313require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlDumper.class.php'); 
    1414 
    15 $t = new lime_test(139, new lime_output_color()); 
     15$t = new lime_test(140, new lime_output_color()); 
    1616 
    1717$parser = new sfYamlParser(); 
  • branches/1.1/test/unit/yaml/sfYamlParserTest.php

    r8286 r8489  
    1212require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlParser.class.php'); 
    1313 
    14 $t = new lime_test(139, new lime_output_color()); 
     14$t = new lime_test(140, new lime_output_color()); 
    1515 
    1616$parser = new sfYamlParser();