fabpot/yaml — Issue #10: just a little note
Author: khobbits
Created: 2012-02-23 22:48:48+00:00
State: open

the method "parseQuotedScalar" is used for two purposes, parsing a delimited string, and a plain string, but when its being given a plain string, it still treats it as delimited, and thus only returns the first string it matches.

If you use something like this, it doesn't really work:

test: 'don't do somthin' like that'

you'd get 'test' to simply equal 'don'.

i'm using this package to do a bit of yaml validation, so i added this snippit to the method

if ((!$delimiters) && (strlen($match[0]) < strlen($scalar))) {
throw new InvalidArgumentException(sprintf("Malformed YAML (check your use of apostrophes and quotes): \n %s.", substr($scalar, $i)));
}