This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Comment: scan_num also handles hexadecimal floats now.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 18 Aug 2014 12:13:18 +0000 (08:13 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 20 Aug 2014 12:20:02 +0000 (08:20 -0400)
toke.c

diff --git a/toke.c b/toke.c
index 0f0641f..be4c8a5 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9781,9 +9781,10 @@ S_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int re
 
   \d(_?\d)*(\.(\d(_?\d)*)?)?[Ee][\+\-]?(\d(_?\d)*)     12 12.34 12.
   \.\d(_?\d)*[Ee][\+\-]?(\d(_?\d)*)                    .34
-  0b[01](_?[01])*
-  0[0-7](_?[0-7])*
-  0x[0-9A-Fa-f](_?[0-9A-Fa-f])*
+  0b[01](_?[01])*                                       binary integers
+  0[0-7](_?[0-7])*                                      octal integers
+  0x[0-9A-Fa-f](_?[0-9A-Fa-f])*                         hexadecimal integers
+  0x[0-9A-Fa-f](_?[0-9A-Fa-f])*(?:\.\d*)?p[+-]?[0-9]+   hexadecimal floats
 
   Like most scan_ routines, it uses the PL_tokenbuf buffer to hold the
   thing it reads.