summaryrefslogtreecommitdiff
path: root/stdscan.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-18 18:31:26 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-18 18:31:26 -0700
commitfe2177fe4287bbfa9205bcd362694f47870a3c30 (patch)
tree8121152ecea8ed93fe0aafd127d02e796240a085 /stdscan.c
parente31747e95bba75c7e27d0a76f0e385c6d12351e2 (diff)
downloadnasm-fe2177fe4287bbfa9205bcd362694f47870a3c30.tar.gz
nasm-fe2177fe4287bbfa9205bcd362694f47870a3c30.tar.bz2
nasm-fe2177fe4287bbfa9205bcd362694f47870a3c30.zip
Support C99-style hexadecimal floating point.
Add support for C99-style hexadecimal floating point. The format is 0x <hexadecimal mantissa> p <binary exponent>. 0x1.0e+1 thus is the same as 2.0.
Diffstat (limited to 'stdscan.c')
-rw-r--r--stdscan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdscan.c b/stdscan.c
index d4ad696..b6a4ee8 100644
--- a/stdscan.c
+++ b/stdscan.c
@@ -130,7 +130,9 @@ int stdscan(void *private_data, struct tokenval *tv)
stdscan_bufptr++;
while (isnumchar(*stdscan_bufptr) ||
((stdscan_bufptr[-1] == 'e'
- || stdscan_bufptr[-1] == 'E')
+ || stdscan_bufptr[-1] == 'E'
+ || stdscan_bufptr[-1] == 'p'
+ || stdscan_bufptr[-1] == 'P')
&& (*stdscan_bufptr == '-' || *stdscan_bufptr == '+'))) {
stdscan_bufptr++;
}