The toggles INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT and SUNSHCMD are no longer needed, they were unconditionally
set.
The toggle NO_REGEX was configurable from the command line, but
disabling it would result in various error messages about the unknown
':C' modifier.
OK sjg@.
When LoadFile reads from /dev/null the buffer will be empty,
appending "\n" just results in an unnecessary extra call
to ParseRawLine.
Reviewed by: rillig
Previously, the error message 'Invalid line' showed only the expanded
line, which might or might not show the actual problem. To be more
helpful, add the unexpanded line to the error message in case they
differ.
Remove the special handling of invalid lines that result from merge
conflicts. RCS is not commonly used anymore, and mentioning CVS was too
specific. By echoing the whole line, the patterns '<<<<<<' and '>>>>>>'
are clear enough to hint at the problem.
In practice, the common situation is that a file is first included,
defines its multiple-inclusion guard and is then skipped instead of
being included again.
The other way round is that the multiple-inclusion guard is defined when
the file is included first. In that case, the file is now regarded as
guarded as well.
The variable cond_min_depth was redundant. It was only accessed while
parsing the makefiles. Merging it into struct IncludedFile removes the
possible confusion between cond_min_depth and including_cond_min_depth.
No functional change.
Move For_Break further up, as the functions in that file are sorted from
small to big. The cast from size_t to unsigned int is required by lint.
In parse.c, move the code into a separate function to keep
ParseDirective small. Its only job is to parse the directive and then
delegate to another function doing the actual work.
In the manual page, remove empty lines.
In the test, ensure that .break stops processing of the .for loop
immediately; anything after the .break is not processed anymore.
Replace ':=' with '=', as there is no need to evaluate '$i' early.
Check the expected value in the .mk file instead of the .exp file, to
keep the reading scope as small as possible.
When .break is encountered within a .for loop
it causes immediate termination.
Outside of a .for loop .break causes a parse error.
Reviewed by: christos
Determining the location where the error occurred is now done by
ParseVErrorInternal. This frees the remaining code from keeping the
filename and the line number together. It also makes Parse_Error short
enough that it might be worth providing a separate function for each of
the 3 log levels.
No functional change.