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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
_type: ExprLet
attrs:
s1:
_type: ExprLiteral
value: "This is an indented multi-line string\nliteral. An amount of whitespace\
\ at\nthe start of each line matching the minimum\nindentation of all lines\
\ in the string\nliteral together will be removed. Thus,\nin this case four\
\ spaces will be\nstripped from each line, even though\n THIS LINE is indented\
\ six spaces.\n\nAlso, empty lines don't count in the\ndetermination of the\
\ indentation level (the\nprevious empty line has indentation 0, but\nit doesn't\
\ matter).\n"
valueType: String
s10:
_type: ExprLiteral
value: ''
valueType: String
s11:
_type: ExprLiteral
value: ''
valueType: String
s12:
_type: ExprLiteral
value: ''
valueType: String
s13:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: "start on network-interfaces\n\nstart script\n\n rm -f /var/run/opengl-driver\n\
\ "
valueType: String
- _type: ExprIf
cond:
_type: ExprVar
value: 'true'
else:
_type: ExprIf
cond:
_type: ExprVar
value: 'true'
else:
_type: ExprLiteral
value: ''
valueType: String
then:
_type: ExprLiteral
value: ln -sf 456 /var/run/opengl-driver
valueType: String
then:
_type: ExprLiteral
value: ln -sf 123 /var/run/opengl-driver
valueType: String
- _type: ExprLiteral
value: "\n\n rm -f /var/log/slim.log\n \nend script\n\nenv SLIM_CFGFILE="
valueType: String
- _type: ExprLiteral
value: abc
valueType: String
- _type: ExprLiteral
value: '
env SLIM_THEMESDIR='
valueType: String
- _type: ExprLiteral
value: def
valueType: String
- _type: ExprLiteral
value: "\nenv FONTCONFIG_FILE=/etc/fonts/fonts.conf \t\t\t\t# !!! cleanup\n\
env XKB_BINDIR="
valueType: String
- _type: ExprLiteral
value: foo
valueType: String
- _type: ExprLiteral
value: "/bin \t\t\t\t# Needed for the Xkb extension.\nenv LD_LIBRARY_PATH="
valueType: String
- _type: ExprLiteral
value: libX11
valueType: String
- _type: ExprLiteral
value: '/lib:'
valueType: String
- _type: ExprLiteral
value: libXext
valueType: String
- _type: ExprLiteral
value: '/lib:/usr/lib/ # related to xorg-sys-opengl - needed to load
libglx for (AI)GLX support (for compiz)
'
valueType: String
- _type: ExprIf
cond:
_type: ExprVar
value: 'true'
else:
_type: ExprIf
cond:
_type: ExprVar
value: 'true'
else:
_type: ExprLiteral
value: ''
valueType: String
then:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: env XORG_DRI_DRIVER_PATH=
valueType: String
- _type: ExprLiteral
value: mesa
valueType: String
- _type: ExprLiteral
value: /lib/modules/dri
valueType: String
isInterpolation: true
then:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: env XORG_DRI_DRIVER_PATH=
valueType: String
- _type: ExprLiteral
value: nvidiaDrivers
valueType: String
- _type: ExprLiteral
value: /X11R6/lib/modules/drivers/
valueType: String
isInterpolation: true
- _type: ExprLiteral
value: " \n\nexec "
valueType: String
- _type: ExprLiteral
value: slim
valueType: String
- _type: ExprLiteral
value: '/bin/slim
'
valueType: String
isInterpolation: true
s14:
_type: ExprLiteral
value: "Escaping of ' followed by ': ''\nEscaping of $ followed by {: ${\nAnd\
\ finally to interpret \\n etc. as in a string: \n, \r, \t.\n"
valueType: String
s15:
_type: ExprLet
attrs:
x:
_type: ExprLiteral
value: bla
valueType: String
body:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: 'foo
'''
valueType: String
- _type: ExprVar
value: x
- _type: ExprLiteral
value: '''
bar
'
valueType: String
isInterpolation: true
s16:
_type: ExprLiteral
value: 'cut -d $''\t'' -f 1
'
valueType: String
s17:
_type: ExprConcatStrings
es:
- _type: ExprConcatStrings
es:
- _type: ExprLiteral
value: ending dollar $
valueType: String
- _type: ExprLiteral
value: $
valueType: String
isInterpolation: false
- _type: ExprLiteral
value: '
'
valueType: String
isInterpolation: false
s18:
_type: ExprLiteral
value: " Lines without any indentation effectively disable the indentation\n\
\ stripping for the entire string:\n\n cat >$out/foo/data <<EOF\n\
\ lasjd\xF6axnasd\nasdom 12398\n\xE4\"\xA7\xC6\u1E9E\xA2\xAB\xBB\u201D\
alsd\nEOF\n"
valueType: String
s19:
_type: ExprLiteral
value: "Empty lines with a bit of whitespace don't affect the indentation calculation:\n\
\nAnd empty lines with more whitespace will have whitespace in the string:\n\
\ \nUnless it's the last line:\n"
valueType: String
s2:
_type: ExprLiteral
value: "If the string starts with whitespace\n followed by a newline, it's stripped,\
\ but\n that's not the case here. Two spaces are\n stripped because of the\
\ \" \" at the start. \n"
valueType: String
s20:
_type: ExprLiteral
value: " Indentation stripping\n must not be impressed by\nthe last line not\
\ being empty"
valueType: String
s21:
_type: ExprLiteral
value: "\t Nor by people\n weirdly mixing tabs\n\tand spaces\n\t"
valueType: String
s3:
_type: ExprLiteral
value: 'This line is indented
a bit further.
'
valueType: String
s4:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: 'Anti-quotations, like '
valueType: String
- _type: ExprIf
cond:
_type: ExprVar
value: 'true'
else:
_type: ExprLiteral
value: not so
valueType: String
then:
_type: ExprLiteral
value: so
valueType: String
- _type: ExprLiteral
value: ', are
also allowed.
'
valueType: String
isInterpolation: true
s5:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: ' The \ is not special here.
'' can be followed by any character except another '', e.g. ''x''.
Likewise for $, e.g. $$ or $varName.
But '' followed by '' is special, as is $ followed by {.
If you want them, use anti-quotations: '
valueType: String
- _type: ExprLiteral
value: ''''''
valueType: String
- _type: ExprLiteral
value: ', '
valueType: String
- _type: ExprLiteral
value: ${
valueType: String
- _type: ExprLiteral
value: '.
'
valueType: String
isInterpolation: true
s6:
_type: ExprLiteral
value: " Tabs are not interpreted as whitespace (since we can't guess\n what\
\ tab settings are intended), so don't use them.\n\tThis line starts with a\
\ space and a tab, so only one\n space will be stripped from each line.\n"
valueType: String
s7:
_type: ExprLiteral
value: 'Also note that if the last line (just before the closing '' '')
consists only of whitespace, it''s ignored. But here there is
some non-whitespace stuff, so the line isn''t removed. '
valueType: String
s8:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: ''
valueType: String
- _type: ExprLiteral
value: '
This shows a hacky way to preserve an empty line after the start.
But there''s no reason to do so: you could just repeat the empty
line.
'
valueType: String
isInterpolation: true
s9:
_type: ExprConcatStrings
es:
- _type: ExprLiteral
value: ''
valueType: String
- _type: ExprLiteral
value: " Similarly you can force an indentation level,\n in this case to\
\ 2 spaces. This works because the anti-quote\n is significant (not whitespace).\n"
valueType: String
isInterpolation: true
body:
_type: ExprList
elems:
- _type: ExprVar
value: s1
- _type: ExprVar
value: s2
- _type: ExprVar
value: s3
- _type: ExprVar
value: s4
- _type: ExprVar
value: s5
- _type: ExprVar
value: s6
- _type: ExprVar
value: s7
- _type: ExprVar
value: s8
- _type: ExprVar
value: s9
- _type: ExprVar
value: s10
- _type: ExprVar
value: s11
- _type: ExprVar
value: s12
- _type: ExprVar
value: s13
- _type: ExprVar
value: s14
- _type: ExprVar
value: s15
- _type: ExprVar
value: s16
- _type: ExprVar
value: s17
- _type: ExprVar
value: s18
- _type: ExprVar
value: s19
- _type: ExprVar
value: s20
- _type: ExprVar
value: s21
|