mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
stdscan: Use nasm_error helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
a14e65699b
commit
b449ce49d9
@ -113,8 +113,7 @@ static int stdscan_handle_brace(struct tokenval *tv)
|
||||
{
|
||||
if (!(tv->t_flag & TFLAG_BRC_ANY)) {
|
||||
/* invalid token is put inside braces */
|
||||
nasm_error(ERR_NONFATAL,
|
||||
"`%s' is not a valid decorator with braces", tv->t_charptr);
|
||||
nasm_nonfatal("`%s' is not a valid decorator with braces", tv->t_charptr);
|
||||
tv->t_type = TOKEN_INVALID;
|
||||
} else if (tv->t_flag & TFLAG_BRC_OPT) {
|
||||
if (is_reg_class(OPMASKREG, tv->t_integer)) {
|
||||
@ -167,10 +166,10 @@ int stdscan(void *private_data, struct tokenval *tv)
|
||||
* is it actually a register or instruction name, or what? */
|
||||
token_type = nasm_token_hash(ourcopy, tv);
|
||||
|
||||
if (unlikely(tv->t_flag & TFLAG_WARN)) {
|
||||
nasm_error(ERR_WARNING|ERR_PASS1|ERR_WARN_PTR,
|
||||
"`%s' is not a NASM keyword", tv->t_charptr);
|
||||
}
|
||||
if (unlikely(tv->t_flag & TFLAG_WARN)) {
|
||||
nasm_warnf(ERR_PASS1|ERR_WARN_PTR, "`%s' is not a NASM keyword",
|
||||
tv->t_charptr);
|
||||
}
|
||||
|
||||
if (likely(!(tv->t_flag & TFLAG_BRC))) {
|
||||
/* most of the tokens fall into this case */
|
||||
@ -285,8 +284,7 @@ int stdscan(void *private_data, struct tokenval *tv)
|
||||
stdscan_bufptr = nasm_skip_spaces(stdscan_bufptr);
|
||||
/* if brace is not closed properly or token is too long */
|
||||
if ((*stdscan_bufptr != '}') || (token_len > MAX_KEYWORD)) {
|
||||
nasm_error(ERR_NONFATAL,
|
||||
"invalid decorator token inside braces");
|
||||
nasm_nonfatal("invalid decorator token inside braces");
|
||||
return tv->t_type = TOKEN_INVALID;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user