diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-10-30 11:29:43 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-10-31 20:05:50 +0300 |
commit | beaef4a2ea9fa1d73eb624af8931ce02c21303cf (patch) | |
tree | 3ffafd07615d824cd0fa0e452f40f03bbb70bcb5 /stdscan.c | |
parent | cfbcddf1a5a1650bcffac98ac1c60792c810bacb (diff) | |
download | nasm-beaef4a2ea9fa1d73eb624af8931ce02c21303cf.tar.gz nasm-beaef4a2ea9fa1d73eb624af8931ce02c21303cf.tar.bz2 nasm-beaef4a2ea9fa1d73eb624af8931ce02c21303cf.zip |
stdscan.c: use TOKEN_EOS and string helpers
Also tab/space cleanup
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'stdscan.c')
-rw-r--r-- | stdscan.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- * - * + * * Copyright 1996-2009 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. @@ -14,7 +14,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -111,10 +111,9 @@ int stdscan(void *private_data, struct tokenval *tv) (void)private_data; /* Don't warn that this parameter is unused */ - while (nasm_isspace(*stdscan_bufptr)) - stdscan_bufptr++; + stdscan_bufptr = nasm_skip_spaces(stdscan_bufptr); if (!*stdscan_bufptr) - return tv->t_type = 0; + return tv->t_type = TOKEN_EOS; /* we have a token; either an id, a number or a char */ if (isidstart(*stdscan_bufptr) || @@ -231,7 +230,7 @@ int stdscan(void *private_data, struct tokenval *tv) return tv->t_type = TOKEN_STR; } else if (*stdscan_bufptr == ';') { /* a comment has happened - stay */ - return tv->t_type = 0; + return tv->t_type = TOKEN_EOS; } else if (stdscan_bufptr[0] == '>' && stdscan_bufptr[1] == '>') { stdscan_bufptr += 2; return tv->t_type = TOKEN_SHR; |