feature request for libyaml: support "\/" escape sequence for YAML 1.2/JSON compatibility
Patrick Pelletier <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
I attempted to submit a feature request ticket for libyaml:
http://pyyaml.org/newticket?component=libyaml
but it rejected my ticket, telling me it was spam. (I could go off on a
whole rant about how so-called "spam filtering" makes it impossible for
legitimate users to get anything done these days, but that would be
off-topic.)
Anyway, since I can't submit a ticket, sending the feature request to
this list seemed like the next-best thing.
Here is the text of the ticket I attempted to submit to libyaml:
YAML 1.2 adds support for the escape sequence "\/", which was not
present in YAML 1.1:
http://www.yaml.org/spec/1.2/spec.html#id2776092
YAML 1.2 added this escape sequence in order to be compatible with JSON.
(Since YAML's goal is to be a superset of JSON.)
Although libyaml is only a YAML 1.1 parser, it would be nice to have
this feature, and adding it shouldn't cause any trouble with parsing
YAML 1.1.
This is all that's needed:
{{{
--- a/scanner.c~
+++ b/scanner.c
@@ -3164,6 +3164,10 @@ yaml_parser_scan_flow_scalar(yaml_parser_t
*parser, yaml_
*(string.pointer++) = '\\';
break;
+ case '/':
+ *(string.pointer++) = '/';
+ break;
+
case 'N': /* NEL (#x85) */
*(string.pointer++) = '\xC2';
*(string.pointer++) = '\x85';
}}}
--Patrick
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d