console.log(YAML.eval("Yaml!"))
- Now does comments (& --- lines)
- Deals with booleans (yes, no, true, false)
- Handles multi-line strings (both types!)
- Single-line hashes now supported
- Knows about indentation
- Can't see how it'll ever get to dealing with pointers
- Can't yet deal with escaping (eg "" around strings)
- Won't do custom classes
If you're extending the Array class (eg. with jQuery, RightJS) then the single line array stuff (line 61 below, at the moment) will break!
Why? Well, some libraries extend the Array class in such a way that when you iterate over the array, not only the elements are iterated over, but also all of the extended functions. There's probably a way around this, but I haven't bothered implementing it yet.
In RightJS I simple swap out these lines
for(var i in contents) {
data.push(this.parse([contents[i]]))
}
return data
For this one:
return contents.map(function(item) { this.parse(item) })