Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 12959
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: ferreira [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.38
Fixed in: (no value)



Subject: bug (+ patch) on nested inline collections with extra blanks
This bug was discovered from a message on YAML-core mailing list. http://sourceforge.net/mailarchive/forum.php?thread_id=7357346&forum_id=1771 This solution has been sent there also. The problem happens when an inline collection (map or sequence) is nested into another inline collection and extra blanks are left among closing brackets. These emit errors: --- { a: {k: v} } => YAML_PARSE_ERR_INLINE_MAP --- { a: [1] } => YAML_PARSE_ERR_INLINE_MAP --- [ {k: v} ] => YAML_PARSE_ERR_INLINE_SEQUENCE --- [ [1] ] => YAML_PARSE_ERR_INLINE_SEQUENCE But slight variations pass through. We could either use a trailing comma --- { a: {k: v}, } --- { a: [1], } --- [ {k: v}, ] --- [ [1], ] or chop the blank --- { a: {k: v}} --- { a: [1]} --- [ {k: v}] --- [ [1]] The fix was too easy. Four lines changed at YAML.pm where '\s*' was added to assure blanks before the closing bracket were allowed. A complete patch based on "YAML-0.39.tar.gz" from CPAN is being submitted. WHAT CHANGED * lib/YAML.pm (4 lines) * t/23inline.t (added) (a script to test the fix worked and didn't break anything else) * Changes * MANIFEST (added t/23inline.t) The update of the version number in lib/YAML.pm is missing. I didn't mean to offend you by touching the files 'Changes' and 'MANIFEST' but just to be more complete. Regards, Adriano R. Ferreira.
Download yaml-diff
application/octet-stream 3.1k

Message body not shown because it is not plain text.