1
2Printing dollar from literals and variables
3
4To 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 => <$$>
9Some hungry part of make eats all the dollars after a :U modifier.
10       1 dollar default => <>
11       2 dollar default => <>
12       4 dollar default => <>
13This works as expected.
14      1 dollar variable => <>
15      2 dollar variable => <$>
16      4 dollar variable => <$$>
17Some 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
22Dollar 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
32Dollar in :C character class
33
34The A is replaced because the $$ is reduced to a single $,
35which is then resolved to the variable X with the value VAR_X.
36The effective character class becomes [VAR_XY].
37         C,[$$XY],<&>,g => <$<A><X><Y>>
38
39Dollar in :C pattern
40
41For some reason, multiple dollars are folded into one.
42           C,$,dollar,g => <>
43          C,$$,dollar,g => <>
44
45Dollar in :S replacement
46
47For 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>
51exit status 0
52