Skip to content

Commit

Permalink
Update for Csound 6.16.0 (#1837)
Browse files Browse the repository at this point in the history
* Update for Csound 6.16.0

* Preserve removed Csound built-ins
  • Loading branch information
nwhetsell committed Jun 20, 2021
1 parent d421a22 commit 94dda68
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 16 deletions.
69 changes: 55 additions & 14 deletions pygments/lexers/_csound_builtins.py
Expand Up @@ -6,7 +6,35 @@
:license: BSD, see LICENSE for details.
"""

# Opcodes in Csound 6.14.0 using:
REMOVED_OPCODES = set('''
OSCsendA
beadsynt
beosc
buchla
getrowlin
lua_exec
lua_iaopcall
lua_iaopcall_off
lua_ikopcall
lua_ikopcall_off
lua_iopcall
lua_iopcall_off
lua_opdef
mp3scal_check
mp3scal_load
mp3scal_load2
mp3scal_play
mp3scal_play2
pvsgendy
socksend_k
signalflowgraph
sumTableFilter
systime
tabrowlin
vbap1move
'''.split())

# Opcodes in Csound 6.16.0 using:
# python3 -c "
# import re
# from subprocess import Popen, PIPE
Expand Down Expand Up @@ -209,22 +237,22 @@
ampmidid
apoleparams
arduinoRead
arduinoReadF
arduinoStart
arduinoStop
areson
aresonk
atone
atonek
atonex
autocorr
babo
balance
balance2
bamboo
barmodel
bbcutm
bbcuts
beadsynt
beosc
betarand
bexprnd
bformdec1
Expand Down Expand Up @@ -259,6 +287,7 @@
ceps
cepsinv
chanctrl
changed
changed2
chani
chano
Expand Down Expand Up @@ -293,6 +322,8 @@
cmplxprod
cntCreate
cntCycles
cntDelete
cntDelete_i
cntRead
cntReset
cntState
Expand Down Expand Up @@ -342,6 +373,11 @@
ctrl21
ctrl7
ctrlinit
ctrlpreset
ctrlprint
ctrlprintpresets
ctrlsave
ctrlselect
cuserrnd
dam
date
Expand Down Expand Up @@ -523,7 +559,6 @@
getcol
getftargs
getrow
getrowlin
getseed
gogobel
grain
Expand Down Expand Up @@ -776,6 +811,7 @@
lastcycle
lenarray
lfo
lfsr
limit
limit1
lincos
Expand Down Expand Up @@ -836,14 +872,6 @@
lpshold
lpsholdp
lpslot
lua_exec
lua_iaopcall
lua_iaopcall_off
lua_ikopcall
lua_ikopcall_off
lua_iopcall
lua_iopcall_off
lua_opdef
lufs
mac
maca
Expand Down Expand Up @@ -920,6 +948,7 @@
mp3sr
mpulse
mrtmsg
ms2st
mtof
mton
multitap
Expand All @@ -929,6 +958,7 @@
mvclpf2
mvclpf3
mvclpf4
mvmfilter
mxadsr
nchnls_hw
nestedap
Expand Down Expand Up @@ -972,6 +1002,7 @@
oscilx
out
out32
outall
outc
outch
outh
Expand Down Expand Up @@ -1279,11 +1310,13 @@
sc_phasor
sc_trig
scale
scale2
scalearray
scanhammer
scans
scantable
scanu
scanu2
schedkwhen
schedkwhennamed
schedule
Expand Down Expand Up @@ -1333,6 +1366,7 @@
sinh
sininv
sinsyn
skf
sleighbells
slicearray
slicearray_i
Expand Down Expand Up @@ -1368,12 +1402,14 @@
spat3di
spat3dt
spdist
spf
splitrig
sprintf
sprintfk
spsend
sqrt
squinewave
st2ms
statevar
sterrain
stix
Expand Down Expand Up @@ -1414,6 +1450,7 @@
sum
sumarray
svfilter
svn
syncgrain
syncloop
syncphasor
Expand Down Expand Up @@ -1454,7 +1491,6 @@
tabmorphi
tabplay
tabrec
tabrowlin
tabsum
tabw
tabw_i
Expand Down Expand Up @@ -1486,6 +1522,8 @@
trcross
trfilter
trhighest
trigExpseg
trigLinseg
trigger
trighold
trigphasor
Expand All @@ -1500,6 +1538,8 @@
trsplit
turnoff
turnoff2
turnoff2_i
turnoff3
turnon
tvconv
unirand
Expand All @@ -1523,6 +1563,7 @@
vbapz
vbapzmove
vcella
vclpf
vco
vco2
vco2ft
Expand Down Expand Up @@ -1611,6 +1652,7 @@
wrap
writescratch
wterrain
wterrain2
xadsr
xin
xout
Expand Down Expand Up @@ -1647,7 +1689,6 @@
array
bformdec
bformenc
changed
copy2ftab
copy2ttab
hrtfer
Expand Down
4 changes: 2 additions & 2 deletions pygments/lexers/csound.py
Expand Up @@ -13,7 +13,7 @@
from pygments.lexer import RegexLexer, bygroups, default, include, using, words
from pygments.token import Comment, Error, Keyword, Name, Number, Operator, Punctuation, \
String, Text, Whitespace
from pygments.lexers._csound_builtins import OPCODES, DEPRECATED_OPCODES
from pygments.lexers._csound_builtins import OPCODES, DEPRECATED_OPCODES, REMOVED_OPCODES
from pygments.lexers.html import HtmlLexer
from pygments.lexers.python import PythonLexer
from pygments.lexers.scripting import LuaLexer
Expand Down Expand Up @@ -219,7 +219,7 @@ def name_callback(lexer, match):
type_annotation_token = Keyword.Type

name = match.group(1)
if name in OPCODES or name in DEPRECATED_OPCODES:
if name in OPCODES or name in DEPRECATED_OPCODES or name in REMOVED_OPCODES:
yield match.start(), Name.Builtin, name
elif name in lexer.user_defined_opcodes:
yield match.start(), Name.Function, name
Expand Down

0 comments on commit 94dda68

Please sign in to comment.