]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/dollar.exp
Merge bmake-20201117
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / dollar.exp
1
2 Printing dollar from literals and variables
3
4 To survive the parser, a dollar sign must be doubled.
5        1 dollar literal => <single-quote-var-value>
6    1 dollar literal eol => <>
7        2 dollar literal => <$>
8        4 dollar literal => <$$>
9 Some hungry part of make eats all the dollars after a :U modifier.
10        1 dollar default => <>
11        2 dollar default => <>
12        4 dollar default => <>
13 This works as expected.
14       1 dollar variable => <>
15       2 dollar variable => <$>
16       4 dollar variable => <$$>
17 Some hungry part of make eats all the dollars after a :U modifier.
18    1 dollar var-default => <>
19    2 dollar var-default => <$>
20    4 dollar var-default => <$$>
21
22 Dollar in :S pattern
23
24               S,$,word, => <$XYword>
25              S,$X,word, => <$XY>
26             S,$$X,word, => <$XY>
27            S,$$$X,word, => <$XY>
28          S,$X,replaced, => <replaced>
29         S,$$X,replaced, => <replaced>
30        S,$$$X,replaced, => <replaced>
31
32 Dollar in :C character class
33
34 The A is replaced because the $$ is reduced to a single $,
35 which is then resolved to the variable X with the value VAR_X.
36 The effective character class becomes [VAR_XY].
37          C,[$$XY],<&>,g => <$<A><X><Y>>
38
39 Dollar in :C pattern
40
41 For some reason, multiple dollars are folded into one.
42            C,$,dollar,g => <>
43           C,$$,dollar,g => <>
44
45 Dollar in :S replacement
46
47 For some reason, multiple dollars are folded into one.
48            S,word,a$Xo, => <aVAR_Xo>
49           S,word,a$$Xo, => <aVAR_Xo>
50          S,word,a$$$Xo, => <aVAR_Xo>
51 exit status 0