The currently-unused strtbl was basically a slightly different version
of strlist, with the find and linearize capabilities. Merge these two
together by augmenting strlist to have the same capabilities.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add binary key support to the hash table interface. Clean up the
interface to contain less extraneous crud.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
ERR_HERE is used to mark messages of the form "... here" so that we
can emit sane output to the list file with filename and line number,
instead of a nonsensical "here" which could point almost anywhere.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Simplify the srcfile subsystem by making it official that any pointer
passed to src_get() needs to have been obtained from the srcfile
subsystem itself.
Move a lot of the srcfile operations into inline code; often they
amount to a single machine instruction...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The differences between nasm_verror_{gnu,vc} are a short handful of
strings, so unify them. Remove some additional ERR_NOFILE that are not
necessary.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The current error handlers are much smarter about missing filenames,
and thus using ERR_NOFILE just makes it harder for the programmer.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
It is fairly easy to more compactly create error helpers since we are
using preprocessor hacks anyway, so do exactly that.
Create nasm_note() helpers for the new NOTE severity class.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If a label is redefined in the same pass, and the value is
inconsistent, then error out. While we are at it, give the source
location of the previous definition.
This explicitly rejects BR 3392535; there seems to be no reason to
reject duplicate definitions with the same value, as there is no
inconsistency involved.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add a new severity level "note", intended to be used to give
additional information about a previous error.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If warnings are errors, print [-w+error=xxxx] and prefix error:.
Use the same spacing for filename and non-filename error messages.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>
-E -MD should work and output a dependency file.
-MD can be used without a filename; there is a default filename or
-\c{-MF} can be used.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Replace all the is*() macros with inline functions. Disallow '?' in
identifiers unless we are in TASM mode.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
is allowed in
Single letter variables in the sequence i, j, k... are normally used
for integer-valued iterators. Rename the token-type variable 'tt', and
use 'tto' (token type, old) when the value is saved across a scan.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
*Every* call to the scanner is of the form i = scan(scpriv, tokval).
Wrap that in a static function instead of duplicating the code over
and over.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There is no point in passing (critical) as an argument when
we alredy rely on a bunch of static variables. If eval needs to be
reentrant, we should instead have something like "struct eval_state"
and pass a pointer to that as an argument.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There is absolutely no reason not to allow relational operators in
arbitrary contexts. and doing so can be quite useful.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There are probably other corner cases where we could at the very
least produce an incorrectly rounded result, so be a bit more cagey
about the description of the bug.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>