blob: e6d0bff95bd3297b4a3e7dcfc0bd0255a69b9b86 (
plain)
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY B '([^a-zA-Z0-9\._"'\$#\[:\(]|\s|^|$)'>
]>
<!--
This file is part of the TDE project
Copyright (C) 2016 José Joaquín Atria <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-->
<language name="Praat" version="2-1" kateversion="2.4" section="Scripts" extensions="*.Praat;*.praat;*.psc;*.praat-script;*.praatscript;*.proc" author="Jose Joaquín Atria ([email protected])" license="LGPLv2">
<highlighting>
<list name="keywords">
<item>assert</item>
<item>clearinfo</item>
<item>demo</item>
<item>elif</item>
<item>else</item>
<item>elsif</item>
<item>from</item>
<item>minus</item>
<item>nocheck</item>
<item>noprogress</item>
<item>nowarn</item>
<item>plus</item>
<item>select</item>
<item>stopwatch</item>
<item>then</item>
<item>to</item>
</list>
<list name="functions_string">
<item>backslashTrigraphsToUnicode$</item>
<item>chooseDirectory$</item>
<item>chooseReadFile$</item>
<item>chooseWriteFile$</item>
<item>date$</item>
<item>demoKey$</item>
<item>do$</item>
<item>environment$</item>
<item>extractLine$</item>
<item>extractWord$</item>
<item>fixed$</item>
<item>info$</item>
<item>left$</item>
<item>mid$</item>
<item>percent$</item>
<item>readFile$</item>
<item>replace$</item>
<item>replace_regex$</item>
<item>right$</item>
<item>selected$</item>
<item>string$</item>
</list>
<list name="functions_numeric">
<item>abs</item>
<item>appendFile</item>
<item>appendFileLine</item>
<item>appendInfo</item>
<item>appendInfoLine</item>
<item>arccos</item>
<item>arccosh</item>
<item>arcsin</item>
<item>arcsinh</item>
<item>arctan</item>
<item>arctan2</item>
<item>arctanh</item>
<item>barkToHertz</item>
<item>beginPause</item>
<item>beginSendPraat</item>
<item>besselI</item>
<item>besselK</item>
<item>beta</item>
<item>beta2</item>
<item>binomialP</item>
<item>binomialQ</item>
<item>boolean</item>
<item>ceiling</item>
<item>chiSquareP</item>
<item>chiSquareQ</item>
<item>choice</item>
<item>comment</item>
<item>cos</item>
<item>cosh</item>
<item>createDirectory</item>
<item>deleteFile</item>
<item>demoClicked</item>
<item>demoClickedIn</item>
<item>demoCommandKeyPressed</item>
<item>demoExtraControlKeyPressed</item>
<item>demoInput</item>
<item>demoKeyPressed</item>
<item>demoOptionKeyPressed</item>
<item>demoShiftKeyPressed</item>
<item>demoShow</item>
<item>demoWaitForInput</item>
<item>demoWindowTitle</item>
<item>demoX</item>
<item>demoY</item>
<item>differenceLimensToPhon</item>
<item>do</item>
<item>editor</item>
<item>endPause</item>
<item>endSendPraat</item>
<item>endsWith</item>
<item>erb</item>
<item>erbToHertz</item>
<item>erf</item>
<item>erfc</item>
<item>exitScript</item>
<item>exp</item>
<item>extractNumber</item>
<item>fileReadable</item>
<item>fisherP</item>
<item>fisherQ</item>
<item>floor</item>
<item>gaussP</item>
<item>gaussQ</item>
<item>hash</item>
<item>hertzToBark</item>
<item>hertzToErb</item>
<item>hertzToMel</item>
<item>hertzToSemitones</item>
<item>imax</item>
<item>imin</item>
<item>incompleteBeta</item>
<item>incompleteGammaP</item>
<item>index</item>
<item>index_regex</item>
<item>integer</item>
<item>invBinomialP</item>
<item>invBinomialQ</item>
<item>invChiSquareQ</item>
<item>invFisherQ</item>
<item>invGaussQ</item>
<item>invSigmoid</item>
<item>invStudentQ</item>
<item>length</item>
<item>ln</item>
<item>lnBeta</item>
<item>lnGamma</item>
<item>log10</item>
<item>log2</item>
<item>max</item>
<item>melToHertz</item>
<item>min</item>
<item>minusObject</item>
<item>natural</item>
<item>number</item>
<item>numberOfColumns</item>
<item>numberOfRows</item>
<item>numberOfSelected</item>
<item>objectsAreIdentical</item>
<item>option</item>
<item>optionMenu</item>
<item>pauseScript</item>
<item>phonToDifferenceLimens</item>
<item>plusObject</item>
<item>positive</item>
<item>randomBinomial</item>
<item>randomGauss</item>
<item>randomInteger</item>
<item>randomPoisson</item>
<item>randomUniform</item>
<item>real</item>
<item>readFile</item>
<item>removeObject</item>
<item>rindex</item>
<item>rindex_regex</item>
<item>round</item>
<item>runScript</item>
<item>runSystem</item>
<item>runSystem_nocheck</item>
<item>selectObject</item>
<item>selected</item>
<item>semitonesToHertz</item>
<item>sentence</item>
<item>sentencetext</item>
<item>sigmoid</item>
<item>sin</item>
<item>sinc</item>
<item>sincpi</item>
<item>sinh</item>
<item>soundPressureToPhon</item>
<item>sqrt</item>
<item>startsWith</item>
<item>studentP</item>
<item>studentQ</item>
<item>tan</item>
<item>tanh</item>
<item>text</item>
<item>variableExists</item>
<item>word</item>
<item>writeFile</item>
<item>writeFileLine</item>
<item>writeInfo</item>
<item>writeInfoLine</item>
</list>
<list name="functions_array">
<item>linear#</item>
<item>randomGauss#</item>
<item>randomInteger#</item>
<item>randomUniform#</item>
<item>zero#</item>
</list>
<list name="variables_numeric">
<item>all</item>
<item>average</item>
<item>e</item>
<item>left</item>
<item>macintosh</item>
<item>mono</item>
<item>pi</item>
<item>praatVersion</item>
<item>right</item>
<item>stereo</item>
<item>undefined</item>
<item>unix</item>
<item>windows</item>
</list>
<list name="variables_string">
<item>praatVersion$</item>
<item>tab$</item>
<item>shellDirectory$</item>
<item>homeDirectory$</item>
<item>preferencesDirectory$</item>
<item>newline$</item>
<item>temporaryDirectory$</item>
<item>defaultDirectory$</item>
</list>
<contexts>
<context name="normal" attribute="normal" lineEndContext="#pop" >
<DetectChar char='#' attribute="comment" context="comment" firstNonSpace="true" />
<IncludeRules context="function check" />
<DetectChar char='@' attribute="function" context="procedure name" firstNonSpace="true" />
<RegExpr String="call&B;" attribute="keyword" context="function word to shorthand arguments" firstNonSpace="true" />
<RegExpr String="include&B;" attribute="keyword" context="unquoted string" firstNonSpace="true" />
<RegExpr String="&B;?if&B;" attribute="keyword" beginRegion="if" />
<RegExpr String="endif&B;" attribute="keyword" endRegion="if" firstNonSpace="true" />
<RegExpr String="&B;?fi&B;" attribute="keyword" endRegion="if" />
<RegExpr String="for&B;" attribute="keyword" beginRegion="for" firstNonSpace="true" />
<RegExpr String="endfor&B;" attribute="keyword" endRegion="for" firstNonSpace="true" />
<RegExpr String="while&B;" attribute="keyword" beginRegion="while" firstNonSpace="true" />
<RegExpr String="endwhile&B;" attribute="keyword" endRegion="while" firstNonSpace="true" />
<RegExpr String="repeat&B;" attribute="keyword" beginRegion="repeat" firstNonSpace="true" />
<RegExpr String="until&B;" attribute="keyword" endRegion="repeat" firstNonSpace="true" />
<RegExpr String="procedure&B;" attribute="keyword" context="procedure name" beginRegion="procedure" firstNonSpace="true" />
<RegExpr String="endproc&B;" attribute="keyword" endRegion="procedure" firstNonSpace="true" />
<StringDetect String="select all" attribute="keyword" firstNonSpace="true" />
<keyword String="keywords" attribute="keyword" />
<RegExpr String="&B;print(line|tab)?&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;echo&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;exit&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;asserterror&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;pause&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;send(praat|socket)&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;execute&B;" attribute="keyword" context="unquoted string" />
<RegExpr String="&B;editor&B;" attribute="keyword" context="unquoted string" beginRegion="editor" />
<RegExpr String="&B;endeditor&B;" attribute="keyword" endRegion="editor" />
<RegExpr String="form&B;" attribute="keyword" context="old form definition" firstNonSpace="true" beginRegion="form" />
<RegExpr String="goto&B;" attribute="keyword" context="label" firstNonSpace="true" />
<RegExpr String="label&B;" attribute="keyword" context="label" firstNonSpace="true" />
<DetectChar char='"' attribute="string" context="quoted string" />
<IncludeRules context="expansion" />
<IncludeRules context="operator" />
<IncludeRules context="variable name" />
<IncludeRules context="number" />
<RegExpr String="\b[A-Z]" attribute="command" context="command" />
<DetectChar char=';' attribute="comment" context="comment" />
</context>
<context name="label" attribute="variable" lineEndContext="#pop" />
<context name="old form definition" attribute="string" lineEndContext="#pop!old form" />
<context name="old form" attribute="normal" lineEndContext="#stay">
<DetectChar char='#' attribute="comment" context="comment" firstNonSpace="true" />
<RegExpr String="choice&B;" attribute="keyword" context="normal word with colon to number" firstNonSpace="true" />
<RegExpr String="optionmenu&B;" attribute="keyword" context="normal word with colon to number" firstNonSpace="true" />
<RegExpr String="option&B;" attribute="keyword" context="unquoted string" firstNonSpace="true" />
<RegExpr String="button&B;" attribute="keyword" context="unquoted string" firstNonSpace="true" />
<RegExpr String="sentence&B;" attribute="keyword" context="normal word to string" firstNonSpace="true" />
<RegExpr String="text&B;" attribute="keyword" context="normal word to string" firstNonSpace="true" />
<RegExpr String="word&B;" attribute="keyword" context="normal word to string word" firstNonSpace="true" />
<RegExpr String="comment&B;" attribute="keyword" context="unquoted string" firstNonSpace="true" />
<RegExpr String="real&B;" attribute="keyword" context="number" firstNonSpace="true" />
<RegExpr String="natural&B;" attribute="keyword" context="number" firstNonSpace="true" />
<RegExpr String="positive&B;" attribute="keyword" context="number" firstNonSpace="true" />
<RegExpr String="integer&B;" attribute="keyword" context="number" firstNonSpace="true" />
<RegExpr String="boolean&B;" attribute="keyword" context="normal word to variable" firstNonSpace="true" />
<RegExpr String="endform&B;" attribute="keyword" context="#pop" endRegion="form" firstNonSpace="true" />
</context>
<context name="operator" attribute="operator" lineEndContext="#pop" >
<RegExpr String="([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)" attribute="operator" />
<RegExpr String="\.(and|or|not|div|mod)" attribute="normal" />
<RegExpr String="(and|or|not|div|mod)\." attribute="normal" />
<WordDetect String="and" attribute="operator" />
<WordDetect String="or" attribute="operator" />
<WordDetect String="not" attribute="operator" />
<WordDetect String="div" attribute="operator" />
<WordDetect String="mod" attribute="operator" />
</context>
<context name="command" attribute="command" lineEndContext="#pop" >
<IncludeRules context="expansion" />
<StringDetect String="..." attribute="command" context="shorthand arguments" />
<DetectChar char=":" attribute="command" context="#pop" />
</context>
<context name="shorthand arguments" attribute="normal" lineEndContext="#pop#pop" >
<IncludeRules context="variable name" />
<IncludeRules context="operator" />
<IncludeRules context="number" />
<DetectChar char='"' attribute="string" context="quoted string" />
</context>
<context name="variable name" attribute="normal" lineEndContext="#pop" >
<IncludeRules context="operator" />
<IncludeRules context="number" />
<keyword String="variables_numeric" attribute="variable" />
<keyword String="variables_string" attribute="variable" />
<RegExpr String="\b[A-Z][a-zA-Z]+_" attribute="object.attribute" context="object reference" />
</context>
<context name="object reference" attribute="object.attribute" lineEndContext="#pop#pop" >
<DetectChar char="." attribute="object.attribute" context="#pop#pop!object attributes" lookAhead="true" />
<IncludeRules context="expansion" />
<DetectChar char="$" attribute="object.attribute" />
<DetectChar char="[" attribute="normal" context="#pop#pop" />
</context>
<context name="object attributes" attribute="normal" lineEndContext="#pop" >
<RegExpr String="\.ncol&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.nrow&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.xmin&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.ymin&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.xmax&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.ymax&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.nx&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.ny&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.dx&B;" attribute="object.attribute" context="#pop" />
<RegExpr String="\.dy&B;" attribute="object.attribute" context="#pop" />
</context>
<context name="normal word with colon to number" attribute="normal" lineEndContext="#pop" >
<DetectChar char=":" attribute="normal" context="number" />
</context>
<context name="normal word to variable" attribute="normal" lineEndContext="#pop" >
<RegExpr String="\b\w+\b" attribute="normal" context="variable" />
</context>
<context name="variable" attribute="variable" lineEndContext="#pop" />
<context name="number" attribute="normal" lineEndContext="#pop" >
<IncludeRules context="operator" />
<RegExpr String="\b\d+(\.\d*)?([eE][-+]?\d+)?%?" attribute="number" />
</context>
<context name="normal word to string word" attribute="normal" lineEndContext="#pop" >
<RegExpr String="\b\w+\b" attribute="normal" context="string word" />
</context>
<context name="normal word to string" attribute="normal" lineEndContext="#pop" >
<RegExpr String="\b\w+\b" attribute="normal" context="unquoted string" />
</context>
<context name="string word" attribute="string" lineEndContext="#pop" >
<RegExpr String="\b\w+\b" attribute="string" context="ignore" />
</context>
<context name="ignore" attribute="normal" lineEndContext="#pop" />
<context name="comment" attribute="comment" lineEndContext="#pop" />
<context name="quoted string" attribute="string" lineEndContext="broken quoted string" >
<IncludeRules context="expansion" />
<DetectChar char='"' attribute="string" context="#pop" />
</context>
<context name="unquoted string" attribute="string" lineEndContext="broken unquoted string" >
<IncludeRules context="expansion" />
</context>
<context name="expansion" attribute="normal" lineEndContext="#pop" >
<RegExpr String="'[^\[\]'"]+(\[([\w\d,]+|"[\w\d,]+")\])?'" attribute="expansion" />
</context>
<context name="broken unquoted string" attribute="string" lineEndContext="#stay" >
<DetectSpaces attribute="normal" />
<StringDetect String="..." attribute="normal" context="#pop" firstNonSpace="true" />
<IncludeRules context="expansion" />
<RegExpr String="[\w\d#@;.]" context="#pop#pop" firstNonSpace="true" lookAhead="true" />
</context>
<context name="broken quoted string" attribute="string" lineEndContext="#stay" >
<IncludeRules context="broken unquoted string" />
<DetectChar char='"' attribute="string" context="#pop#pop" />
</context>
<context name="function check" attribute="normal" lineEndContext="#pop" >
<keyword String="functions_numeric" attribute="normal" context="numeric function check" lookAhead="true" />
<keyword String="functions_string" attribute="normal" context="string function check" lookAhead="true" />
<keyword String="functions_array" attribute="normal" context="array function check" lookAhead="true" />
</context>
<context name="array function check" attribute="normal" lineEndContext="#pop" >
<RegExpr String="[a-zA-Z0-9_]+# *[:(]" attribute="normal" context="function call" lookAhead="true" />
<DetectChar char=" " context="#pop#pop" />
</context>
<context name="string function check" attribute="normal" lineEndContext="#pop" >
<RegExpr String="[a-zA-Z0-9_]+\$ *[:(]" attribute="normal" context="function call" lookAhead="true" />
<DetectChar char=" " context="#pop#pop" />
</context>
<context name="numeric function check" attribute="normal" lineEndContext="#pop" >
<RegExpr String="[a-zA-Z0-9_]+ *[:(]" attribute="normal" context="function call" lookAhead="true" />
<RegExpr String="&B;editor&B;" attribute="keyword" context="#pop#pop!unquoted string" beginRegion="editor" />
<DetectChar char=" " context="#pop#pop" />
</context>
<context name="function call" attribute="function" lineEndContext="#pop" >
<RegExpr String="&B;beginSendPraat&B;" beginRegion="sendpraat" />
<RegExpr String="&B;endSendPraat&B;" endRegion="sendpraat" />
<RegExpr String="&B;beginPause&B;" beginRegion="pause" />
<RegExpr String="&B;endPause&B;" endRegion="pause" />
<DetectSpaces attribute="normal" />
<DetectChar char=":" attribute="normal" context="#pop#pop#pop" />
<DetectChar char="(" attribute="normal" context="#pop#pop#pop" />
</context>
<context name="procedure name" attribute="function" lineEndContext="#pop" >
<DetectChar char=":" attribute="normal" context="#pop" />
<DetectChar char="(" attribute="normal" context="#pop" />
<IncludeRules context="expansion" />
<DetectSpaces attribute="normal" context="#pop" />
</context>
<context name="function word to shorthand arguments" attribute="function" lineEndContext="#pop" >
<DetectChar char=":" attribute="normal" context="#pop" />
<DetectChar char="(" attribute="normal" context="#pop" />
<IncludeRules context="expansion" />
<DetectSpaces attribute="normal" context="#pop!shorthand arguments" />
</context>
</contexts>
<itemDatas>
<itemData name="normal" defStyleNum="dsNormal" />
<itemData name="number" defStyleNum="dsDecVal" />
<itemData name="object.attribute" defStyleNum="dsDecVal" />
<itemData name="variable" defStyleNum="dsDataType" />
<itemData name="keyword" defStyleNum="dsKeyword" />
<itemData name="expansion" defStyleNum="dsSpecialString" />
<itemData name="string" defStyleNum="dsString" />
<itemData name="command" defStyleNum="dsFunction" />
<itemData name="function" defStyleNum="dsFunction" />
<itemData name="operator" defStyleNum="dsOperator" />
<itemData name="comment" defStyleNum="dsComment" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" />
</comments>
<keywords casesensitive="true" weakDeliminator="._#$" />
</general>
</language>
|