mustangostang / spyc

A simple YAML loader/dumper class for PHP
MIT License
701 stars 207 forks source link

greedilyNeedNextLine() unexpectedly returning true #5

Closed meechanism closed 11 years ago

meechanism commented 11 years ago

Hello!

First off, thanks for writing this parser. It's been great! Unfortunately, we hit a snag and wanted to inform you.

We found a bug when parsing a particular line. An array with a comment at the end of the line seems to give us trouble. In this case, the next line will be tacked on to the previous, and therefore lost because it is appended to a comment

Example Yaml input: foo: [x, y, z] # Comment here bar: kittens

Example parsed: foo: [x, y, z] # Comment here bar: kittens

It looks like there is a bug in greedilyNeedNextLine()'s regex.

Thanks for everything!