Lines Matching +full:two +full:- +full:word
1 # $NetBSD: varmod-sysv.mk,v 1.22 2025/01/11 20:54:46 rillig Exp $
16 # The modifier applies to each word on its own.
17 .if ${one.c two.c three.c:L:.c=.o} != "one.o two.o three.o"
32 # word. In this case, the "from" string is empty, therefore it always
38 # The modifier ':from=to' can also be used to surround each word by strings.
41 .if ${one two three:L:%=(%)} != "(one) (two) (three)"
53 .if ${one two:L:${:Uone}=${:U1}} != "1 two"
63 # XXX: The right-hand side should be expanded only once.
78 # single empty word, or no word at all. The modifier ':from=to' treats it as
79 # no word at all.
87 # single empty word (before 2020-05-06), or no word at all (since 2020-05-06).
94 # Before 2020-07-19, an ampersand could be used in the replacement part
98 # This was probably a copy-and-paste mistake since the code for the SysV
104 # Before 2020-07-19, the result of the expression was "a.bcd.e".
109 # Before 2020-07-20, when a SysV modifier was parsed, a single dollar
116 # Before 2020-07-20, the modifier ':e$=x' was parsed as having a left-hand
117 # side 'e' and a right-hand side 'x'. The dollar was parsed (but not
139 # It's also possible to modify each word by replacing the prefix and adding
141 .if ${one two:L:o%=a%w} != "anew two"
145 # Each word gets the suffix "X" appended.
146 .if ${one two:L:=X} != "oneX twoX"
151 .if ${one two:L:o=X} != "one twX"
156 .if ${one two:L:o=} != "one tw"
161 # a wildcard when it appears on the left-hand side.
162 .if ${one two:L:o=%} != "one tw%"
166 # Each word with the suffix "o" is replaced with "X". The percent is a
167 # wildcard even though the right-hand side does not contain another percent.
168 .if ${one two:L:%o=X} != "one X"
172 # Each word with the prefix "o" is replaced with "X". The percent is a
173 # wildcard even though the right-hand side does not contain another percent.
174 .if ${one two:L:o%=X} != "X two"
178 # For each word with the prefix "o" and the suffix "e", the whole word is
180 .if ${one two oe oxen:L:o%e=X} != "X two X oxen"
185 .if ${one two o%e other%e:L:o%%e=X} != "one two X X"
191 .if ${one two:L:%=%%} != "one% two%"
195 # In the word "one", only a prefix of the pattern suffix "nes" matches,
196 # the whole word is too short. Therefore it doesn't match.
197 .if ${one two:L:%nes=%xxx} != "one two"
202 # of a word with other strings. This is not possible with a single :S
205 .if ${prefix-middle-suffix:L:prefix-%-suffix=p-%-s} != "p-middle-s"
211 # XXX: As of 2024-06-30, this expression generates an "Unfinished modifier"
222 # parses the modifier as "from${:D=}to", ending at the '}'. Next, the two
224 # differently, properly handling nested expressions. The two parts
230 # As of 2020-10-06, the right-hand side of the SysV modifier is expanded
232 # modifier is split into its two parts. The second expansion happens
233 # when each word is replaced in ModifyWord_SYSVSubst.
244 !=1>&2 printf '%-24s %-24s %-24s\n' 'word' 'modifier' 'result'
247 . for word in '' suffix prefix pre-middle-suffix
249 !=1>&2 printf '%-24s %-24s "%s"\n' ''${word:Q} ''${mod:Q} ''${word:N'':${mod}:Q}