File: 13-act.dat

package info (click to toggle)
libstring-interpolate-named-perl 1.06-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 148 kB
  • sloc: perl: 430; makefile: 2
file content (66 lines) | stat: -rw-r--r-- 1,238 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# No substitutions
abcd			abcd

# Percent -> %
ab%cd			ab%cd
# Dollar -> $
ab$cd			ab$cd

# Lone brace
ab{cd			ab{cd
ab${cd			ab${cd
ab}cd			ab}cd

# Variable
ab${head}def		abyesdef
ab${head}def${head}xy	abyesdefyesxy
${head}def		yesdef
${h}def			Zdef
${true}			1
${false}		0

# Subtitute the value
X${head}Y		XyesY
X${head=yes}Y		XY
X${head=no}Y		XY

# Subtitute the 'true' part
X${head|foo}Y		XfooY
X${head|fo\|o}Y		Xfo|oY
X${head|1}Y		X1Y
X${head|0}Y		X0Y
X${hexd|foo}Y		XY
X|${hexd|fo\|o}|Y	X||Y

# ${} refers to the value of the key.
X${head|This is ${}!}Y	XThis is yes!Y
X${head=yes|This is ${}!}Y	XThis is yes!Y
X${head=no|This is ${}!}Y	XY
X${capo=1|${} capo|${} capoes}Y	X1 capoY
X${capo=0|${} capoes|${} capo}Y	X1 capoY

# But only within a ${ ... }.
X${}Y			X${}Y

# Subtitute the 'false' part
X${head=no|foo|bar}Y	XbarY
X${hexd|foo|bar}Y	XbarY
X${hexd=yes|foo|bar}Y	XbarY
X${hexd=no|foo|bar}Y	XbarY
X${hexd=|foo|bar}Y	XfooY
X${hexd|foo|0}Y		X0Y
X${h|foo|bar}Y		XfooY
X${h=Z|foo|bar}Y	XfooY

# Nested.
X${head|x${foo}z|bar}Y	XxzY
X${hexd|x${foo}z|bar}Y	XbarY

# Note that ${} is the value of foo (inner), not head (outer)
X${head|x${foo|ab|f${}g}z}Y	XxfgzY

# Recursive substitution.
${subtitle}	CAPO 1

# Transpose.
${key}		G