summaryrefslogtreecommitdiff
path: root/asm/stdscan.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-11-28 14:55:58 -0800
committerH. Peter Anvin <hpa@zytor.com>2018-11-28 14:55:58 -0800
commit1350620bf1dc474b39ca05eb9ba23813a90042b5 (patch)
tree3ba5001319b61d490d63f96bcd13c2efacd38fcf /asm/stdscan.c
parent099cc177398df447ee7153ab29337f00dbcc9d16 (diff)
downloadnasm-1350620bf1dc474b39ca05eb9ba23813a90042b5.tar.gz
ctype: create our own ctype table
Create our own ctype table where we can do the tests we want to do cheaply, instead of calling ctype functions and then adding additional tests all over the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'asm/stdscan.c')
-rw-r--r--asm/stdscan.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/asm/stdscan.c b/asm/stdscan.c
index 24f9b9c4..30cba3e2 100644
--- a/asm/stdscan.c
+++ b/asm/stdscan.c
@@ -137,8 +137,8 @@ int stdscan(void *private_data, struct tokenval *tv)
return tv->t_type = TOKEN_EOS;
/* we have a token; either an id, a number or a char */
- if (isidstart(*stdscan_bufptr) ||
- (*stdscan_bufptr == '$' && isidstart(stdscan_bufptr[1]))) {
+ if (nasm_isidstart(*stdscan_bufptr) ||
+ (*stdscan_bufptr == '$' && nasm_isidstart(stdscan_bufptr[1]))) {
/* now we've got an identifier */
bool is_sym = false;
int token_type;
@@ -150,7 +150,7 @@ int stdscan(void *private_data, struct tokenval *tv)
r = stdscan_bufptr++;
/* read the entire buffer to advance the buffer pointer but... */
- while (isidchar(*stdscan_bufptr))
+ while (nasm_isidchar(*stdscan_bufptr))
stdscan_bufptr++;
/* ... copy only up to IDLEN_MAX-1 characters */
@@ -178,7 +178,7 @@ int stdscan(void *private_data, struct tokenval *tv)
} else {
return tv->t_type = TOKEN_ID;
}
- } else if (*stdscan_bufptr == '$' && !isnumchar(stdscan_bufptr[1])) {
+ } else if (*stdscan_bufptr == '$' && !nasm_isnumchar(stdscan_bufptr[1])) {
/*
* It's a $ sign with no following hex number; this must
* mean it's a Here token ($), evaluating to the current
@@ -191,7 +191,7 @@ int stdscan(void *private_data, struct tokenval *tv)
return tv->t_type = TOKEN_BASE;
}
return tv->t_type = TOKEN_HERE;
- } else if (isnumstart(*stdscan_bufptr)) { /* now we've got a number */
+ } else if (nasm_isnumstart(*stdscan_bufptr)) { /* now we've got a number */
bool rn_error;
bool is_hex = false;
bool is_float = false;
@@ -224,7 +224,7 @@ int stdscan(void *private_data, struct tokenval *tv)
is_float = true;
if (*stdscan_bufptr == '+' || *stdscan_bufptr == '-')
stdscan_bufptr++;
- } else if (isnumchar(c))
+ } else if (nasm_isnumchar(c))
; /* just advance */
else if (c == '.')
is_float = true;
@@ -273,7 +273,7 @@ int stdscan(void *private_data, struct tokenval *tv)
* read the entire buffer to advance the buffer pointer
* {rn-sae}, {rd-sae}, {ru-sae}, {rz-sae} contain '-' in tokens.
*/
- while (isbrcchar(*stdscan_bufptr))
+ while (nasm_isbrcchar(*stdscan_bufptr))
stdscan_bufptr++;
token_len = stdscan_bufptr - r;