Commit Graph

19 Commits

Author SHA1 Message Date
rillig 873c42efc3 make: provide more context information for parse/evaluate errors 2024-04-20 10:18:55 +00:00
rillig 68c43e85ca make: do not evaluate indirect modifiers in parse-only mode
Discovered by sjg.
2024-02-04 10:03:10 +00:00
rillig 86d09a000c make: in parse-only mode, don't evaluate modifiers
Previously, the ':S', ':ts', ':tA' and ':from=to' modifiers were
evaluated in parse-only mode, unnecessarily.  This is only noticeable
when an indirect modifier is evaluated in parse-only mode, which is
another bug that will be fixed in a follow-up commit.
2024-02-04 09:56:24 +00:00
rillig 985de0af40 tests/make: extend test for wrong evaluation in parse-only mode 2024-02-04 09:29:50 +00:00
rillig 4aa832f99f tests/make: indirect modifiers are evaluated in parse-only mode
Found by sjg@.
2024-02-04 08:51:57 +00:00
rillig da2f1f9711 tests/make: replace 'variable expressions' with 'expressions' 2023-11-19 22:32:44 +00:00
rillig 1da4da3f90 tests/make: replace 'variable expression' with 'expression'
Each expression is based on a variable, there's no need for the
verbosity.  The wording in make's diagnostics will be changed in a
follow-up commit.
2023-11-19 21:47:52 +00:00
rillig 73d0a5078e tests/make: force line-based diagnostics to be listed in the tests
This way, contradictions between the intended output and the actual
output are closer together and have a better chance of being spotted.
2023-06-01 20:56:35 +00:00
rillig 250e8719cd tests/make: ensure that the 'expect' comments in tests are correct
Based on tests/usr.bin/xlint/check-expect.lua.

For now, this extra check needs to be run manually.
2022-01-15 12:35:18 +00:00
rillig 577ef4e8d4 make: fix reported line numbers of continuation lines (since 2002)
Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line, which is
more usual.  This also affected the debug log from '-dp'.
2022-01-08 20:21:34 +00:00
rillig ebbd921098 make: rename ApplyModifiersState to ModChain
The new name accurately describes the structural element that holds such
properties as the separator character and whether the expression value
is considered a single word.  The old name ApplyModifiersState was too
long and was meant as a placeholder anyway, when I introduced it in
var.c 1.236 from 2020-07-03.
2021-03-15 20:00:50 +00:00
rillig 73654455e2 make: add test for indirect ':U' modifier
Unlike ':ts' and ':tW', the effects of ':U' are visible even after the
modifiers from the nested expression have been applied.  These subtle
details, like many others, are not documented in the manual page.
2021-02-14 17:47:33 +00:00
rillig a6cd09f3da make: document since when indirect modifiers are supported 2021-02-14 17:22:37 +00:00
rillig 7d5825c040 make: add more tests for edge cases in evaluating variable expressions
As a preparation for refactoring the code around variable expressions,
there need to be a few tests for indirect variable modifiers since these
were not covered before.

Indirect modifiers may include ':ts' and ':tW', which change the
interpretation of the variable expression in small details.  The scope
of these changes is limited to the indirect modifier, any evaluations
outside this indirect modifier are unaffected.

The changes to the .exp file are mostly line number changes, plus a
demonstration of a newly found bug, where an expression is evaluated
successfully despite producing a parse error.
2021-02-14 16:12:46 +00:00
rillig 7eb297894b make(1): split test for indirect modifiers into paragraphs 2020-12-27 17:32:25 +00:00
rillig 970a54cb9f make(1): add tests for parsing indirect modifiers in nested expressions 2020-12-27 17:17:46 +00:00
rillig 9524640e66 make(1): remove dead code from ApplyModifiersIndirect
At that point, the expression can never be varUndefined.  At the
beginning of ParseVarnameLong, the expression is initialized to a simple
empty string, and that string is only ever converted to varUndefined at
the very end of Var_Parse.
2020-12-27 16:31:58 +00:00
rillig 374368e991 make(1): move tests for indirect modifiers around
The next commit will error out on unknown modifiers and influence the
exit status.  The test modmisc.mk contains both parse time tests and run
time tests.  To prevent the latter from being run, the parse error is
moved to varmod-indirect.mk, which only contains parse time tests.
2020-12-20 19:29:06 +00:00
rillig 583d8bd566 make(1): add test and tutorial for indirect modifiers 2020-12-01 22:16:36 +00:00