Ticket #292 (new defect)

Opened 10 months ago

Quoted array/collection keys?

Reported by: libyaml@… Owned by: xi
Priority: low Component: libyaml
Severity: normal Keywords:


How come some array/collection keys are emitted in quotes, and, respectively, have to be in quotes to be parsed correctly?

Keys in question are, e.g.: n, no, y, yes (but not: ye, 3, m...)

I feel like there's pattern (which I couldn't find documentation of) and that I'm missing something here. I'm sorry if this is a dumb question.

I haven't encountered this behavior (which somewhat impacts "human writeability") in other parsers. Note: I use the PHP/PECL version 0.1.4:

echo yaml_emit(array('m'=>1,'yes'=>2));


m: 1
"yes": 2



Add a comment

Modify Ticket

Change Properties
<Author field>
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.