Re: Colons in an anchor name
William Spitzak <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Looks like a problem. libyaml rejects this on input but produces exactly
this text on output! Example:
> echo "population:\n *wi : 5 million\n *il : 10 million" > a
> cat a
population:
*wi : 5 million
*il : 10 million
> libyaml-stable/tests/example-reformatter < a > b
> cat b
population:
*wi: 5 million
*il: 10 million
> libyaml-stable/tests/example-reformatter < b
Parser error: while parsing a block mapping at line 1, column 1
did not find expected key at line 2, column 8
I would recommend altering the definition so that an anchor name follows
exactly the same rules as an unquoted key.
Jesse Beder wrote:
> The spec currently defines an ns-anchor-name to be any ns-char except [ ] { } ,
>
> To my eye, though, the following looks like it should be right:
>
> states:
> - &wi Wisconsin
> - &il Illinois
>
> population:
> *wi: 5 million
> *il: 10 million
>
> But you'd need a space between the alias name and the colon to make it
> match the spec. Why isn't a colon disallowed in anchor names (or at
> least colon+space)?
>
> Thanks,
> Jesse Beder
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d