summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-28 08:34:26 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-28 08:34:26 +0000
commit61f33854a9297ada503a0aaeb7eed1072b0de126 (patch)
tree518634181440bc5443d5cd7417486608835ae7ef /toke.c
parentb8ec4db0281494f81643a75b165d473ad70184cd (diff)
downloadperl-61f33854a9297ada503a0aaeb7eed1072b0de126.tar.gz
[PATCH lib/overload.t] TODO tests for bug #24313.
From: Abigail <abigail@abigail.nl> Date: Mon, 27 Oct 2003 13:05:37 +0100 Message-ID: <20031027120536.GA24608@abigail.nl> Subject: [PATCH bleadperl] [perl #24313] (was Re: [PATCH lib/overload.t] TODO tests for bug #24313.) From: Rick Delaney <rick@bort.ca> Date: Mon, 27 Oct 2003 12:17:49 -0500 Message-ID: <20031027121749.E2233@biff.bort.ca> p4raw-id: //depot/perl@21566
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index b6b81d244b..3b010ec2a2 100644
--- a/toke.c
+++ b/toke.c
@@ -7252,6 +7252,7 @@ Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
UV u = 0;
I32 shift;
bool overflowed = FALSE;
+ bool just_zero = TRUE; /* just plain 0 or binary number? */
static NV nvshift[5] = { 1.0, 2.0, 4.0, 8.0, 16.0 };
static char* bases[5] = { "", "binary", "", "octal",
"hexadecimal" };
@@ -7268,9 +7269,11 @@ Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
if (s[1] == 'x') {
shift = 4;
s += 2;
+ just_zero = FALSE;
} else if (s[1] == 'b') {
shift = 1;
s += 2;
+ just_zero = FALSE;
}
/* check for a decimal in disguise */
else if (s[1] == '.' || s[1] == 'e' || s[1] == 'E')
@@ -7342,6 +7345,7 @@ Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
*/
digit:
+ just_zero = FALSE;
if (!overflowed) {
x = u << shift; /* make room for the digit */
@@ -7400,7 +7404,10 @@ Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
#endif
sv_setuv(sv, u);
}
- if (PL_hints & HINT_NEW_BINARY)
+ if (just_zero && (PL_hints & HINT_NEW_INTEGER))
+ sv = new_constant(start, s - start, "integer",
+ sv, Nullsv, NULL);
+ else if (PL_hints & HINT_NEW_BINARY)
sv = new_constant(start, s - start, "binary", sv, Nullsv, NULL);
}
break;