| Age | Commit message (Collapse) | Author |
|
No functional change.
|
|
These patterns shouldn't occur in practice, as their results are tricky
to predict. Generate a warning for now, and maybe an error later.
Reviewed by sjg@.
|
|
I commonly use __${.PARSEDIR:tA}__ where a unique guard
is needed, __${.PARSEDIR}__ is also useful in many cases.
Combination of patch from rillig and mine
|
|
This style is used by FreeBSD, among others.
|
|
|
|
No functional change.
|
|
"looks reasonable" sjg@
|
|
No binary change.
|
|
No functional change.
|
|
No functional change.
|
|
The return value of Var_Parse is largely redundant to the returned
string. The idea behind the type VarParseResult was to migrate all call
sites to checking this return value instead of the returned string, but
that hasn't happened. Instead, the additional type only added more
complexity.
There was a single place where that return value was actually used, when
parsing conditions. And even in that case, ignoring the VarParseResult
added back an error message that previously hid bugs, in the test
cond-token-plain.mk.
Even though these error messages are redundant in the other tests, they
don't hurt as they don't happen often.
|
|
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.
|
|
The previous names were confusing since they suggested that cond_depth
instead of cond_min_depth would be saved and restored.
No functional change.
|
|
This puts the functions into chronological order, as saving happens
before restoring.
No functional change.
|
|
When the nesting level of conditionals is restored to an unreasonably
high value, the error message "0 open conditionals" doesn't make sense.
|
|
To avoid errors from unclosed conditionals on .break
it is sufficient to just set cond_depth = cond_min_depth.
Patch from rillig
|
|
This allows a tiny optimization in the switch statement.
No functional change.
|
|
Before:
String comparison operator must be either == or !=
After:
Comparison with '>=' requires both operands 'no' and '10' to be numeric
Noticed by martin@ in pkgsrc/textproc/py-pygments.
|
|
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
|
|
The bug in deptgt-silent-jobs.mk has been fixed, the debug logging for
comparing conditions and for deleting global variables has changed
intentionally.
|
|
No binary change.
|
|
That function not only parses function arguments but also bare words, so
the name argBuf didn't match anymore.
No binary change.
|
|
|
|
No functional change.
|
|
No binary change for -DNDEBUG.
|
|
No binary change.
|
|
No binary change.
|
|
The latter function already existed in 1993, no idea why it was not
used.
No functional change.
|
|
No functional change.
|
|
No binary change except for assertion line numbers.
|
|
No binary change.
|
|
In ParseWord, the expressions '*p' and 'ch' are the same.
In ParseDependencyTargetWord, clean up a wordy comment and join two
conditions.
In the test cond-token-number, clarify that make doesn't convert from
hex to decimal but only from hex to internal representation.
No functional change.
|
|
|
|
No functional change.
|
|
Combining two similar but fundamentally different parsing tasks in a
single function only increased the complexity, of the implementation as
well as the call sites.
The code makes it obvious now that a function argument is a bare word
surrounded by parentheses.
The special case of an empty word is only needed for the function
argument, it cannot occur in a bare word. The code for that has been
moved to the caller. Such an empty word not only occurs for 'defined()'
but also for 'defined(${:U})'.
No functional change.
|
|
Merge the two return values (bool, string) into a single return value.
As before, the caller cannot observe the difference between a parse
error and an empty word, both are handled in the same way.
In CondParser_ComparisonOrLeaf, the word cannot be empty since the
calling function CondParser_Token already handles all cases that could
lead to an empty word.
No functional change.
|
|
The result of irrelevant leaves is effectively ignored by CondParser_And
and CondParser_Or. Use the 'doEval &&' pattern to make the code
consistent with CondParser_Comparison and CondParser_FuncCall.
No functional change.
|
|
When a condition contains an irrelevant function call, it doesn't matter
whether the function call evaluates to true or to false, it will be
discarded anyway by either CondParser_And or CondParser_Or.
Returning false instead of true makes the code simpler, plus it is more
common to return false for irrelevant results.
No functional change.
|
|
No functional change.
|
|
The code for looking up the function from the table forced the compiler
to use a specific memory layout. Replacing the table with explicit code
provides the compiler more opportunities to optimize the code. Another
side effect is that there are fewer pointer operations.
Previously, is_token checked that the character after the word does not
continue the word, this is now done separately since for the function
lookup, this check was unnecessary. The newly added skip_string
provides a higher abstraction level, it is no longer necessary to pass
the string length as a separate, redundant parameter.
No functional change.
|
|
No functional change.
|
|
No binary change.
|
|
No binary change.
|
|
No functional change.
|
|
No functional change.
|
|
No binary change.
|
|
|
|
Assisted by indent(1), with manual corrections due to its many remaining
bugs.
No functional change.
|
|
No binary change, except for line numbers in assertions in suff.c.
|
|
No functional change.
|