HomePhorge

Quote strings containing hex numbers when generating ZAML
49eabd406577Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

Quote strings containing hex numbers when generating ZAML

When generating ZAML, we prefer to write bare strings when possible. To
that end, we have rules about which sorts of strings are not safe to
write bare. One of those rules is strings containing numbers (for if we
wrote those bare, they would be revived as numbers). However, ZAML
wasn't properly considering hex digits when identifying a string
containing a number, resulting in those strings being written unquoted,
and revived incorrectly as numbers.

That is, YAML.load(ZAML.dump("0xffff")) would return 65535, when it ought
to be "0xffff".

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU2d51b642fcd1: Merge pull request #602 from cprice-puppet/bug/2.7.x/13439-spec-api…
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPU49eabd406577: Quote strings containing hex numbers when generating ZAML (authored by Nick Lewis <nick@puppetlabs.com>).Mar 28 2012, 2:42 AM