mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-12-08 06:21:40 +01:00
33793: add 0b binary interpretation to integer constants
This commit is contained in:
parent
c4110f7f4e
commit
a8927bf27b
4 changed files with 13 additions and 3 deletions
|
|
@ -449,12 +449,14 @@ lexconstant(void)
|
|||
nptr++;
|
||||
|
||||
if (*nptr == '0') {
|
||||
int lowchar;
|
||||
nptr++;
|
||||
if (*nptr == 'x' || *nptr == 'X') {
|
||||
lowchar = tolower(*nptr);
|
||||
if (lowchar == 'x' || lowchar == 'b') {
|
||||
/* Let zstrtol parse number with base */
|
||||
yyval.u.l = zstrtol_underscore(ptr, &ptr, 0, 1);
|
||||
/* Should we set lastbase here? */
|
||||
lastbase = 16;
|
||||
lastbase = (lowchar == 'b') ? 2 : 16;
|
||||
if (isset(FORCEFLOAT))
|
||||
{
|
||||
yyval.type = MN_FLOAT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue