7546:bf5f777260a6 | 7547:21b0534faebc |
---|---|
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """ | 2 """ |
3 pygments.lexers._csound_builtins | 3 pygments.lexers._csound_builtins |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 | 5 |
6 :copyright: Copyright 2006-2018 by the Pygments team, see AUTHORS. | 6 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. |
7 :license: BSD, see LICENSE for details. | 7 :license: BSD, see LICENSE for details. |
8 """ | 8 """ |
9 | 9 |
10 # Opcodes in Csound 6.12.0 at commit 6ca322bd31f1ca907c008616b40a5f237ff449db using | 10 # Opcodes in Csound 6.14.0 using: |
11 # python -c " | 11 # python3 -c " |
12 # import re, subprocess | 12 # import re |
13 # output = subprocess.Popen(['csound', '--list-opcodes0'], stderr=subprocess.PIPE).communicate()[1] | 13 # from subprocess import Popen, PIPE |
14 # opcodes = output[re.search(r'^$', output, re.M).end():re.search(r'^\d+ opcodes$', output, re.M).start()].split() | 14 # output = Popen(['csound', '--list-opcodes0'], stderr=PIPE, text=True).communicate()[1] |
15 # output = subprocess.Popen(['csound', '--list-opcodes2'], stderr=subprocess.PIPE).communicate()[1] | 15 # opcodes = output[re.search(r'^\$', output, re.M).end() : re.search(r'^\d+ opcodes\$', output, re.M).start()].split() |
16 # all_opcodes = output[re.search(r'^$', output, re.M).end():re.search(r'^\d+ opcodes$', output, re.M).start()].split() | 16 # output = Popen(['csound', '--list-opcodes2'], stderr=PIPE, text=True).communicate()[1] |
17 # all_opcodes = output[re.search(r'^\$', output, re.M).end() : re.search(r'^\d+ opcodes\$', output, re.M).start()].split() | |
17 # deprecated_opcodes = [opcode for opcode in all_opcodes if opcode not in opcodes] | 18 # deprecated_opcodes = [opcode for opcode in all_opcodes if opcode not in opcodes] |
18 # print '''OPCODES = set(\''' | 19 # # Remove opcodes that csound.py treats as keywords. |
19 # {} | 20 # keyword_opcodes = [ |
21 # 'cggoto', # https://csound.com/docs/manual/cggoto.html | |
22 # 'cigoto', # https://csound.com/docs/manual/cigoto.html | |
23 # 'cingoto', # (undocumented) | |
24 # 'ckgoto', # https://csound.com/docs/manual/ckgoto.html | |
25 # 'cngoto', # https://csound.com/docs/manual/cngoto.html | |
26 # 'cnkgoto', # (undocumented) | |
27 # 'endin', # https://csound.com/docs/manual/endin.html | |
28 # 'endop', # https://csound.com/docs/manual/endop.html | |
29 # 'goto', # https://csound.com/docs/manual/goto.html | |
30 # 'igoto', # https://csound.com/docs/manual/igoto.html | |
31 # 'instr', # https://csound.com/docs/manual/instr.html | |
32 # 'kgoto', # https://csound.com/docs/manual/kgoto.html | |
33 # 'loop_ge', # https://csound.com/docs/manual/loop_ge.html | |
34 # 'loop_gt', # https://csound.com/docs/manual/loop_gt.html | |
35 # 'loop_le', # https://csound.com/docs/manual/loop_le.html | |
36 # 'loop_lt', # https://csound.com/docs/manual/loop_lt.html | |
37 # 'opcode', # https://csound.com/docs/manual/opcode.html | |
38 # 'reinit', # https://csound.com/docs/manual/reinit.html | |
39 # 'return', # https://csound.com/docs/manual/return.html | |
40 # 'rireturn', # https://csound.com/docs/manual/rireturn.html | |
41 # 'rigoto', # https://csound.com/docs/manual/rigoto.html | |
42 # 'tigoto', # https://csound.com/docs/manual/tigoto.html | |
43 # 'timout' # https://csound.com/docs/manual/timout.html | |
44 # ] | |
45 # opcodes = [opcode for opcode in opcodes if opcode not in keyword_opcodes] | |
46 # newline = '\n' | |
47 # print(f'''OPCODES = set(\''' | |
48 # {newline.join(opcodes)} | |
20 # \'''.split()) | 49 # \'''.split()) |
21 # | 50 # |
22 # DEPRECATED_OPCODES = set(\''' | 51 # DEPRECATED_OPCODES = set(\''' |
23 # {} | 52 # {newline.join(deprecated_opcodes)} |
24 # \'''.split()) | 53 # \'''.split()) |
25 # '''.format('\n'.join(opcodes), '\n'.join(deprecated_opcodes)) | 54 # ''') |
26 # " | 55 # " |
27 # except for | |
28 # cggoto csound.com/docs/manual/cggoto.html | |
29 # cigoto csound.com/docs/manual/cigoto.html | |
30 # cingoto (undocumented) | |
31 # ckgoto csound.com/docs/manual/ckgoto.html | |
32 # cngoto csound.com/docs/manual/cngoto.html | |
33 # cnkgoto (undocumented) | |
34 # endin csound.com/docs/manual/endin.html | |
35 # endop csound.com/docs/manual/endop.html | |
36 # goto csound.com/docs/manual/goto.html | |
37 # igoto csound.com/docs/manual/igoto.html | |
38 # instr csound.com/docs/manual/instr.html | |
39 # kgoto csound.com/docs/manual/kgoto.html | |
40 # loop_ge csound.com/docs/manual/loop_ge.html | |
41 # loop_gt csound.com/docs/manual/loop_gt.html | |
42 # loop_le csound.com/docs/manual/loop_le.html | |
43 # loop_lt csound.com/docs/manual/loop_lt.html | |
44 # opcode csound.com/docs/manual/opcode.html | |
45 # reinit csound.com/docs/manual/reinit.html | |
46 # return csound.com/docs/manual/return.html | |
47 # rireturn csound.com/docs/manual/rireturn.html | |
48 # rigoto csound.com/docs/manual/rigoto.html | |
49 # tigoto csound.com/docs/manual/tigoto.html | |
50 # timout csound.com/docs/manual/timout.html | |
51 # which are treated as keywords in csound.py. | |
52 | 56 |
53 OPCODES = set(''' | 57 OPCODES = set(''' |
54 ATSadd | 58 ATSadd |
55 ATSaddnz | 59 ATSaddnz |
56 ATSbufread | 60 ATSbufread |
167 STKBlowHole | 171 STKBlowHole |
168 STKBowed | 172 STKBowed |
169 STKBrass | 173 STKBrass |
170 STKClarinet | 174 STKClarinet |
171 STKDrummer | 175 STKDrummer |
176 STKFMVoices | |
172 STKFlute | 177 STKFlute |
173 STKFMVoices | |
174 STKHevyMetl | 178 STKHevyMetl |
175 STKMandolin | 179 STKMandolin |
176 STKModalBar | 180 STKModalBar |
177 STKMoog | 181 STKMoog |
178 STKPercFlut | 182 STKPercFlut |
199 alpass | 203 alpass |
200 alwayson | 204 alwayson |
201 ampdb | 205 ampdb |
202 ampdbfs | 206 ampdbfs |
203 ampmidi | 207 ampmidi |
208 ampmidicurve | |
204 ampmidid | 209 ampmidid |
205 areson | 210 areson |
206 aresonk | 211 aresonk |
207 atone | 212 atone |
208 atonek | 213 atonek |
247 cent | 252 cent |
248 centroid | 253 centroid |
249 ceps | 254 ceps |
250 cepsinv | 255 cepsinv |
251 chanctrl | 256 chanctrl |
252 changed | |
253 changed2 | 257 changed2 |
254 chani | 258 chani |
255 chano | 259 chano |
256 chebyshevpoly | 260 chebyshevpoly |
257 checkbox | 261 checkbox |
259 chn_a | 263 chn_a |
260 chn_k | 264 chn_k |
261 chnclear | 265 chnclear |
262 chnexport | 266 chnexport |
263 chnget | 267 chnget |
268 chngeta | |
269 chngeti | |
270 chngetk | |
264 chngetks | 271 chngetks |
272 chngets | |
265 chnmix | 273 chnmix |
266 chnparams | 274 chnparams |
267 chnset | 275 chnset |
276 chnseta | |
277 chnseti | |
278 chnsetk | |
268 chnsetks | 279 chnsetks |
280 chnsets | |
269 chuap | 281 chuap |
270 clear | 282 clear |
271 clfilt | 283 clfilt |
272 clip | 284 clip |
273 clockoff | 285 clockoff |
416 flanger | 428 flanger |
417 flashtxt | 429 flashtxt |
418 flooper | 430 flooper |
419 flooper2 | 431 flooper2 |
420 floor | 432 floor |
433 fluidAllOut | |
434 fluidCCi | |
435 fluidCCk | |
436 fluidControl | |
437 fluidEngine | |
438 fluidInfo | |
439 fluidLoad | |
440 fluidNote | |
441 fluidOut | |
442 fluidProgramSelect | |
443 fluidSetInterpMethod | |
421 fmanal | 444 fmanal |
422 fmax | 445 fmax |
423 fmb3 | 446 fmb3 |
424 fmbell | 447 fmbell |
425 fmin | 448 fmin |
450 freeverb | 473 freeverb |
451 ftaudio | 474 ftaudio |
452 ftchnls | 475 ftchnls |
453 ftconv | 476 ftconv |
454 ftcps | 477 ftcps |
478 ftexists | |
455 ftfree | 479 ftfree |
456 ftgen | 480 ftgen |
457 ftgenonce | 481 ftgenonce |
458 ftgentmp | 482 ftgentmp |
459 ftlen | 483 ftlen |
490 gogobel | 514 gogobel |
491 grain | 515 grain |
492 grain2 | 516 grain2 |
493 grain3 | 517 grain3 |
494 granule | 518 granule |
519 gtf | |
495 guiro | 520 guiro |
496 harmon | 521 harmon |
497 harmon2 | 522 harmon2 |
498 harmon3 | 523 harmon3 |
499 harmon4 | 524 harmon4 |
597 la_i_mr_set | 622 la_i_mr_set |
598 la_i_multiply_mc | 623 la_i_multiply_mc |
599 la_i_multiply_mr | 624 la_i_multiply_mr |
600 la_i_multiply_vc | 625 la_i_multiply_vc |
601 la_i_multiply_vr | 626 la_i_multiply_vr |
627 la_i_norm1_mc | |
628 la_i_norm1_mr | |
629 la_i_norm1_vc | |
630 la_i_norm1_vr | |
602 la_i_norm_euclid_mc | 631 la_i_norm_euclid_mc |
603 la_i_norm_euclid_mr | 632 la_i_norm_euclid_mr |
604 la_i_norm_euclid_vc | 633 la_i_norm_euclid_vc |
605 la_i_norm_euclid_vr | 634 la_i_norm_euclid_vr |
606 la_i_norm_inf_mc | 635 la_i_norm_inf_mc |
607 la_i_norm_inf_mr | 636 la_i_norm_inf_mr |
608 la_i_norm_inf_vc | 637 la_i_norm_inf_vc |
609 la_i_norm_inf_vr | 638 la_i_norm_inf_vr |
610 la_i_norm_max_mc | 639 la_i_norm_max_mc |
611 la_i_norm_max_mr | 640 la_i_norm_max_mr |
612 la_i_norm1_mc | |
613 la_i_norm1_mr | |
614 la_i_norm1_vc | |
615 la_i_norm1_vr | |
616 la_i_print_mc | 641 la_i_print_mc |
617 la_i_print_mr | 642 la_i_print_mr |
618 la_i_print_vc | 643 la_i_print_vc |
619 la_i_print_vr | 644 la_i_print_vr |
620 la_i_qr_eigen_mc | 645 la_i_qr_eigen_mc |
695 la_k_mr_set | 720 la_k_mr_set |
696 la_k_multiply_mc | 721 la_k_multiply_mc |
697 la_k_multiply_mr | 722 la_k_multiply_mr |
698 la_k_multiply_vc | 723 la_k_multiply_vc |
699 la_k_multiply_vr | 724 la_k_multiply_vr |
725 la_k_norm1_mc | |
726 la_k_norm1_mr | |
727 la_k_norm1_vc | |
728 la_k_norm1_vr | |
700 la_k_norm_euclid_mc | 729 la_k_norm_euclid_mc |
701 la_k_norm_euclid_mr | 730 la_k_norm_euclid_mr |
702 la_k_norm_euclid_vc | 731 la_k_norm_euclid_vc |
703 la_k_norm_euclid_vr | 732 la_k_norm_euclid_vr |
704 la_k_norm_inf_mc | 733 la_k_norm_inf_mc |
705 la_k_norm_inf_mr | 734 la_k_norm_inf_mr |
706 la_k_norm_inf_vc | 735 la_k_norm_inf_vc |
707 la_k_norm_inf_vr | 736 la_k_norm_inf_vr |
708 la_k_norm_max_mc | 737 la_k_norm_max_mc |
709 la_k_norm_max_mr | 738 la_k_norm_max_mr |
710 la_k_norm1_mc | |
711 la_k_norm1_mr | |
712 la_k_norm1_vc | |
713 la_k_norm1_vr | |
714 la_k_qr_eigen_mc | 739 la_k_qr_eigen_mc |
715 la_k_qr_eigen_mr | 740 la_k_qr_eigen_mr |
716 la_k_qr_factor_mc | 741 la_k_qr_factor_mc |
717 la_k_qr_factor_mr | 742 la_k_qr_factor_mr |
718 la_k_qr_sym_eigen_mc | 743 la_k_qr_sym_eigen_mc |
730 la_k_trace_mr | 755 la_k_trace_mr |
731 la_k_upper_solve_mc | 756 la_k_upper_solve_mc |
732 la_k_upper_solve_mr | 757 la_k_upper_solve_mr |
733 la_k_vc_set | 758 la_k_vc_set |
734 la_k_vr_set | 759 la_k_vr_set |
760 lastcycle | |
735 lenarray | 761 lenarray |
736 lfo | 762 lfo |
737 limit | 763 limit |
738 limit1 | 764 limit1 |
739 lincos | 765 lincos |
820 mclock | 846 mclock |
821 mdelay | 847 mdelay |
822 median | 848 median |
823 mediank | 849 mediank |
824 metro | 850 metro |
851 metro2 | |
825 mfb | 852 mfb |
826 midglobal | 853 midglobal |
827 midiarp | 854 midiarp |
828 midic14 | 855 midic14 |
829 midic21 | 856 midic21 |
898 nreverb | 925 nreverb |
899 nrpn | 926 nrpn |
900 nsamp | 927 nsamp |
901 nstance | 928 nstance |
902 nstrnum | 929 nstrnum |
930 nstrstr | |
931 ntof | |
903 ntom | 932 ntom |
904 ntrpol | 933 ntrpol |
905 nxtpow2 | 934 nxtpow2 |
906 octave | 935 octave |
907 octcps | 936 octcps |
1028 product | 1057 product |
1029 pset | 1058 pset |
1030 ptable | 1059 ptable |
1031 ptable3 | 1060 ptable3 |
1032 ptablei | 1061 ptablei |
1033 ptableiw | |
1034 ptablew | 1062 ptablew |
1035 ptrack | 1063 ptrack |
1036 puts | 1064 puts |
1037 pvadd | 1065 pvadd |
1038 pvbufread | 1066 pvbufread |
1173 pyrunt | 1201 pyrunt |
1174 qinf | 1202 qinf |
1175 qnan | 1203 qnan |
1176 r2c | 1204 r2c |
1177 rand | 1205 rand |
1206 randc | |
1178 randh | 1207 randh |
1179 randi | 1208 randi |
1180 random | 1209 random |
1181 randomh | 1210 randomh |
1182 randomi | 1211 randomi |
1233 scantable | 1262 scantable |
1234 scanu | 1263 scanu |
1235 schedkwhen | 1264 schedkwhen |
1236 schedkwhennamed | 1265 schedkwhennamed |
1237 schedule | 1266 schedule |
1267 schedulek | |
1238 schedwhen | 1268 schedwhen |
1239 scoreline | 1269 scoreline |
1240 scoreline_i | 1270 scoreline_i |
1241 seed | 1271 seed |
1242 sekere | 1272 sekere |
1335 streson | 1365 streson |
1336 strfromurl | 1366 strfromurl |
1337 strget | 1367 strget |
1338 strindex | 1368 strindex |
1339 strindexk | 1369 strindexk |
1370 string2array | |
1340 strlen | 1371 strlen |
1341 strlenk | 1372 strlenk |
1342 strlower | 1373 strlower |
1343 strlowerk | 1374 strlowerk |
1344 strrindex | 1375 strrindex |
1345 strrindexk | 1376 strrindexk |
1346 strset | 1377 strset |
1378 strstrip | |
1347 strsub | 1379 strsub |
1348 strsubk | 1380 strsubk |
1349 strtod | 1381 strtod |
1350 strtodk | 1382 strtodk |
1351 strtol | 1383 strtol |
1378 tablei | 1410 tablei |
1379 tableicopy | 1411 tableicopy |
1380 tableigpw | 1412 tableigpw |
1381 tableikt | 1413 tableikt |
1382 tableimix | 1414 tableimix |
1383 tableiw | |
1384 tablekt | 1415 tablekt |
1385 tablemix | 1416 tablemix |
1386 tableng | 1417 tableng |
1387 tablera | 1418 tablera |
1388 tableseg | 1419 tableseg |
1587 | 1618 |
1588 DEPRECATED_OPCODES = set(''' | 1619 DEPRECATED_OPCODES = set(''' |
1589 array | 1620 array |
1590 bformdec | 1621 bformdec |
1591 bformenc | 1622 bformenc |
1623 changed | |
1592 copy2ftab | 1624 copy2ftab |
1593 copy2ttab | 1625 copy2ttab |
1594 hrtfer | 1626 hrtfer |
1595 ktableseg | 1627 ktableseg |
1596 lentab | 1628 lentab |
1597 maxtab | 1629 maxtab |
1598 mintab | 1630 mintab |
1599 pop | 1631 pop |
1600 pop_f | 1632 pop_f |
1633 ptableiw | |
1601 push | 1634 push |
1602 push_f | 1635 push_f |
1603 scalet | 1636 scalet |
1604 sndload | 1637 sndload |
1605 soundout | 1638 soundout |
1614 specsum | 1647 specsum |
1615 spectrum | 1648 spectrum |
1616 stack | 1649 stack |
1617 sumtab | 1650 sumtab |
1618 tabgen | 1651 tabgen |
1652 tableiw | |
1619 tabmap | 1653 tabmap |
1620 tabmap_i | 1654 tabmap_i |
1621 tabslice | 1655 tabslice |
1622 tb0 | 1656 tb0 |
1623 tb0_init | 1657 tb0_init |