summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-01 12:54:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-01 12:54:24 +0000
commitdbc0d4f2f139c3775c592bb9d20ada906e3aa68e (patch)
treebd9ee5e86f271d0c274ac2e292d05fb991390291 /toke.c
parentf76b0f6998c929fc8d564ca3ed8728a19879ebc7 (diff)
downloadperl-dbc0d4f2f139c3775c592bb9d20ada906e3aa68e.tar.gz
Provide the \N{U+HHHH} syntax before we forget.
p4raw-id: //depot/perl@16302
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 7d37b39bf4..5635e2cb43 100644
--- a/toke.c
+++ b/toke.c
@@ -1540,6 +1540,16 @@ S_scan_const(pTHX_ char *start)
e = s - 1;
goto cont_scan;
}
+ if (e > s + 2 && s[1] == 'U' && s[2] == '+') {
+ /* \N{U+...} */
+ I32 flags = PERL_SCAN_ALLOW_UNDERSCORES |
+ PERL_SCAN_DISALLOW_PREFIX;
+ s += 3;
+ len = e - s;
+ uv = grok_hex(s, &len, &flags, NULL);
+ s = e + 1;
+ goto NUM_ESCAPE_INSERT;
+ }
res = newSVpvn(s + 1, e - s - 1);
res = new_constant( Nullch, 0, "charnames",
res, Nullsv, "\\N{...}" );