introduce a struct that holds all the information about an argument
vector and pass that around.
Author: Max Okumoto <okumoto@ucsd.edu>
Obtained from: DragonFlyBSD
context (and only in one place to substitute the .for variable). Therefor
there is no need to pass the context as a parameter.
Patch: 7.197
Submitted by: Max Okumoto <okumoto@ucsd.edu>
take everything after -- as either a macro assignment or a target.
Note that make still reorders arguments before --: anything starting
with a dash is considered an option, anything which contains an equal
sign is considered a macro assignment and everything else a target.
This still is not POSIX with regard to the options, but it will probably
not change because it has been make's behaviour for ages.
Add a new function Var_Match() that correctly skips a macro call by just
doing the same as Var_Subst() but without producing output. This will help
making the parser more robust.
Patches: 7.190,7.191
Submitted by: Max Okumoto <okumoto@ucsd.edu>
only one variable and Var_Subst() which substitutes all. Split out the
test whether a variable should not be expanded into match_var().
Make access to the input string consistently using str[]. Remove two
unused functions: Var_GetTail() and Var_GetHead().
Patches: 7.184-7.189
Submitted by: Max Okumoto <okumoto@ucsd.edu>
make macro into the environment of programs executed by make. This
has approximately the same function as gmake's export directive.
The form of a pseudo target was deliberately choosen to minimize work
for POSIX compatibility (Makefiles are not allowed to use any targets
starting with a dot and consisting only of uppercase letters except those
specified in the standard when they want POSIX compatible behaviour, so
such a Makefile can never contain .EXPORTVAR.)
Change the handling of macros coming from the environment: instead
of asking the environment for each variable we could not find otherwise
put all the environment variables in a special variable environment just
at start up.
This has been tested on the ports cluster by kris.
Submitted by: Max Okumoto <okumoto@ucsd.edu>
of flags originally passed to VarFind(). This eliminates the code by
removing a bunch of tests.
Patch: 7.173
Submitted by: Max Okumoto <okumoto@ucsd.edu>
characters so it is not safe to move around code from
before it to after it. This should fix problems with building the
documentation.
Patch: 7.170
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Remove unreachable code for VAR_NOSUBST - it was never set.
Replace redundant code with calls to VarGetPattern().
Patch: 7.143-7.145
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Change the parsing of the C modifier flags so that specifying both
'1' and 'g' gives an error.
Patch: 7.141,7.142
Submitted by: Max Okumoto <okumoto@ucsd.edu>
is always a '$'. This is not always correct, for example for
conditionals: .if defined(foobar).
Clean up some comments.
Move common code out of if-statements.
Patch: 7.140
Submitted by: Max Okumoto <okumoto@ucsd.edu>
by the caller. Don't pass 'endc' - it can be computed from 'startc'.
Remove unneccessary temporary variables. Remove constant if-expressions
and remove code before call Fatal() - there is no point to cleanup before
aborting.
Patch: 7.134,7.135
Submitted by: Max Okumoto <okumoto@ucsd.edu>
occurence which actually holds always the same constant value.
Shorten the name pattern to patt.
Patch: 7.133
Submitted by: Max Okumoto <okumoto@ucsd.edu>
by putting them into struct VarParser or computing them (consumed).
Change the loop termination condition in VarParseLong from endc to \0.
Patch: 7.128-7.132
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Reduce the number of arguments passed between these functions by
creating a special-purpose struct.
Patch: 7.120,7.121
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Rename result variable so common code becomes more visible.
Rename freePtr to freeResult to make clear what pointer must be freed.
Patch: 7.116, 7.116a
Submitted by: Max Okumoto <okumoto@ucsd.edu>
the loop. Add a comment why the 'consumed' variable is updated.
Rename lengthPtr to consumed.
Patch: 7.115
Submitted by: Max Okumoto <okumoto@ucsd.edu>
ParseRestModifier() and ParseRestEnd(): move advancement of ptr to remove
a confusing calculation.
VarParseLong(): cleanup calculation of consumed.
Patch: 7.114
Submitted by: Max Okumoto <okumoto@ucsd.edu>
actual variable lookup. Consistently rename lengthPtr to consumed.
Update a number of comments to match the code.
Patch: 7.111-113
Submitted by: Max Okumoto <okumoto@ucsd.edu>