diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2010-07-15 17:28:28 -0600 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-07-17 21:50:48 -0400 |
commit | f0a2b745ce6c03aec6412d79ce0b782f20eddce4 (patch) | |
tree | d1786b1a4a80f6b848dca1ab4eba6e3ffd5dc5d1 /toke.c | |
parent | 8e4698ef1ed0da722532bfcc769ba22fe85c4b47 (diff) | |
download | perl-f0a2b745ce6c03aec6412d79ce0b782f20eddce4.tar.gz |
Add \o{} escape
This commit adds the new construct \o{} to express a character constant
by its octal ordinal value, along with ancillary tests and
documentation.
A function to handle this is added to util.c, and it is called from the
3 parsing places it could occur. The function is a candidate for
in-lining, though I doubt that it will ever be used frequently.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2879,6 +2879,20 @@ S_scan_const(pTHX_ char *start) } goto NUM_ESCAPE_INSERT; + /* eg. \o{24} indicates the octal constant \024 */ + case 'o': + { + STRLEN len; + + char* error = grok_bslash_o(s, &uv, &len, 1); + s += len; + if (error) { + yyerror(error); + continue; + } + goto NUM_ESCAPE_INSERT; + } + /* eg. \x24 indicates the hex constant 0x24 */ case 'x': ++s; |