Home | History | Annotate | Download | only in unit-tests

Lines Matching refs:For

1 # $NetBSD: directive-for-empty.mk,v 1.4 2024/05/31 07:13:12 rillig Exp $
3 # Tests for .for loops containing conditions of the form 'empty(var:...)'.
5 # When a .for loop is expanded, expressions in the body of the loop
15 # In the body of the .for loop, the expression '${i:M*2*}' is replaced with
17 # replacement creates the impression that .for variables were real variables,
19 .for i in 11 12 13
29 # named 'i', this condition makes for a leaky abstraction. If the .for
31 .for i in 11 12 13
32 # Asking for an empty iteration variable does not make sense as the .for loop
37 # The typical way of mistakenly using 'empty' with variables from .for loops
42 # Instead of the 'empty' function, the variables from .for loops can be
50 # The idea of replacing every occurrences of 'empty(i' in the body of a .for
53 # function call or not, as demonstrated by the following examples. For
55 # dollar almost always starts an expression. For counterexamples and
56 # edge cases, see directive-for-escape.mk. Adding another such tricky detail
59 .for i in value
83 # the .for loops in a separate scope. To match the current behavior, there
84 # has to be one scope per included file. There may be .for loops using the
87 # outer.mk: .for i in outer
91 # . for i in inner
99 # that variables from .for loops can only affect expressions in the current
100 # file. If variables from .for loops were implemented as global variables,
103 # To emulate this exact behavior for the function 'empty', each file in the
107 # Another tricky detail are nested .for loops in a single file that use the
109 # would be difficult to understand for humans as well. Technically, they are
110 # possible though. Assuming there are two nested .for loops, both using the
111 # variable 'i'. When the inner .for loop ends, the inner 'i' needs to be
113 # again. This would suggest to use one variable scope per .for loop.
115 # Using a separate scope has the benefit that Var_Parse already allows for
119 # This would mean that the combination of a .for variable and the modifiers
124 # from .for loops and the modifiers mentioned above.