mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
stdscan.c: use TOKEN_EOS and string helpers
Also tab/space cleanup Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
cfbcddf1a5
commit
beaef4a2ea
11
stdscan.c
11
stdscan.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user