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