Skip to content

Commit 5b9099c

Browse files
author
H. Peter Anvin
committed
asm/parser: print the actual token in an error, not its value
Printing an internal token value is not very user-friendly :) Print the contents of the actual token in question. Fixes: #90 Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent 8d4710d commit 5b9099c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

asm/parser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ insn *parse_line(char *buffer, insn *result, const int bits)
12021202
i = tokval.t_type;
12031203
}
12041204
if (!recover && i != 0 && i != ',') {
1205-
nasm_nonfatal("comma, decorator or end of line expected, got %d", i);
1205+
nasm_nonfatal("comma, decorator or end of line expected, got `%*s'",
1206+
(int)tokval.t_len, tokval.t_start);
12061207
recover = true;
12071208
}
12081209
} else { /* immediate operand */

0 commit comments

Comments
 (0)