The NetBSD Project

CVS log for src/usr.bin/make/unit-tests/parse-var.mk

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.9 / (download) - annotate - [select for diffs], Sun Nov 19 21:47:52 2023 UTC (4 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

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.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Feb 18 11:16:09 2023 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.7: +16 -21 lines
Diff to previous 1.7 (colored)

make: fix parsing of unevaluated subexpressions with unbalanced '{}'

Since var.c 1.323 from 2020-07-26, modifiers containing unbalanced
braces or parentheses were parsed differently, depending on whether they
were relevant or not.

For example, the expression '${VAR:...}' is enclosed with braces. When
this expression has a modifier ':S,},}},g' that would double each '}' in
that expression, the parser got confused:

If the expression was relevant, the modifier was parsed as usual, taking
into account that the 3 '}' in the modifier are ordinary characters.

If the expression was irrelevant, the parser only counted the '{' and
the '}', without taking into account that a '}' might be escaped by a
'\' or be an ordinary character.  Parsing therefore stopped at the first
'}', assuming it would finish the expression '${VAR:S,}'.

This parsing mode of only counting balanced '{' and '}' makes sense for
the modifier ':@var@...@', which expands each word of the expression
using the template from the '...'.  These templates tend to be simple
enough that counting the '{' and '}' suffices.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 14 21:56:48 2023 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.6: +2 -3 lines
Diff to previous 1.6 (colored)

make: remove redundant type VarParseResult

No functional change.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Sep 25 21:26:23 2022 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.5: +74 -1 lines
Diff to previous 1.5 (colored)

tests/make: document how variable evaluation needs to be tested

It's about 100_000 combinations to cover the basic edge cases.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Aug 23 19:22:01 2022 UTC (19 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.4: +6 -4 lines
Diff to previous 1.4 (colored)

make: revert parsing of modifier parts (since 2022-08-08)

The modifier ':@var@body@' parses the body in parse-only mode and later
uses Var_Subst on it, in which each literal '$' must be written as '$$'.

Trying to parse the loop body using Var_Parse treated the text
'$${var:-0}' as a single '$' followed by the expression '${var:-0}',
wrongly complaining about the 'Unknown modifier "-0"'.

Found by sjg.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Aug 8 19:53:28 2022 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

tests/make: document history of bug in parsing unbalanced expressions

The bug was introduced in var.c 1.323, which merged two flags that
sounded as if they had been exact opposites: VAR_NOSUBST (later named
VARE_NOSUBST) and VARE_WANTRES.

Before that commit, the branch where make only counted braces instead of
properly parsing the nested expression was only taken in the modifiers
':@var@body@' and '::=', but not in ':S' and ':C'.

After merging the two flags, the modifier parts of ':S' and ':C' had to
be balanced as well, otherwise parsing would fail in cases where the
expression was only parsed, not evaluated.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Aug 8 18:23:30 2022 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.2: +21 -14 lines
Diff to previous 1.2 (colored)

make: fix parsing of modifiers containing unbalanced subexpressions

Revision 1.2 / (download) - annotate - [select for diffs], Sat Aug 6 21:26:05 2022 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.1: +44 -5 lines
Diff to previous 1.1 (colored)

tests/make: demonstrate bug in parsing of modifier parts

In the modifier ':S,from,to,', parsing the two parts 'from' and 'to' of
the modifier differs depending on whether the expression is actually
evaluated or merely parsed.  This not only applies to the ':S' modifier,
but also to ':C', ':@var@body@', ':!cmd!', ':[...]', ':?:', '::=' and
':from=to'.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Oct 4 06:53:15 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x

make(1): add tests for parsing assignments, especially :sh

Luckily nobody uses the :sh variable assignment modifier since its
syntactical variant != is simpler.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>