147 'root': [ |
147 'root': [ |
148 (r'\n', Text), |
148 (r'\n', Text), |
149 include('whitespace and macro uses'), |
149 include('whitespace and macro uses'), |
150 include('preprocessor directives'), |
150 include('preprocessor directives'), |
151 |
151 |
152 (r'[abCdefiqstvxy]', Keyword), |
152 (r'[aBbCdefiqstvxy]', Keyword), |
153 # There is also a w statement that is generated internally and should not be |
153 # There is also a w statement that is generated internally and should not be |
154 # used; see https://github.com/csound/csound/issues/750. |
154 # used; see https://github.com/csound/csound/issues/750. |
155 |
155 |
156 (r'z', Keyword.Constant), |
156 (r'z', Keyword.Constant), |
157 # z is a constant equal to 800,000,000,000. 800 billion seconds is about |
157 # z is a constant equal to 800,000,000,000. 800 billion seconds is about |
239 |
239 |
240 tokens = { |
240 tokens = { |
241 'root': [ |
241 'root': [ |
242 (r'\n', Text), |
242 (r'\n', Text), |
243 |
243 |
244 (r'^([ \t]*)(\w+)(:)(?:[ \t]+|$)', bygroups(Text, Name.Label, Punctuation)), |
244 (r'^([ \t]*)(\w+)(:)([ \t]+|$)', bygroups(Text, Name.Label, Punctuation, Text)), |
245 |
245 |
246 include('whitespace and macro uses'), |
246 include('whitespace and macro uses'), |
247 include('preprocessor directives'), |
247 include('preprocessor directives'), |
248 |
248 |
249 (r'\binstr\b', Keyword.Declaration, 'instrument numbers and identifiers'), |
249 (r'\binstr\b', Keyword.Declaration, 'instrument numbers and identifiers'), |
337 # prints https://csound.com/docs/manual/prints.html |
337 # prints https://csound.com/docs/manual/prints.html |
338 # sprintf https://csound.com/docs/manual/sprintf.html |
338 # sprintf https://csound.com/docs/manual/sprintf.html |
339 # sprintfk https://csound.com/docs/manual/sprintfk.html |
339 # sprintfk https://csound.com/docs/manual/sprintfk.html |
340 # work with strings that contain format specifiers. In addition, these opcodes’ |
340 # work with strings that contain format specifiers. In addition, these opcodes’ |
341 # handling of format specifiers is inconsistent: |
341 # handling of format specifiers is inconsistent: |
342 # - fprintks, fprints, printks, and prints do accept %a and %A |
342 # - fprintks and fprints accept %a and %A specifiers, and accept %s specifiers |
343 # specifiers, but can’t accept %s specifiers. |
343 # starting in Csound 6.15.0. |
344 # - printf, printf_i, sprintf, and sprintfk don’t accept %a and %A |
344 # - printks and prints accept %a and %A specifiers, but don’t accept %s |
345 # specifiers, but can accept %s specifiers. |
345 # specifiers. |
|
346 # - printf, printf_i, sprintf, and sprintfk don’t accept %a and %A specifiers, |
|
347 # but accept %s specifiers. |
346 # See https://github.com/csound/csound/issues/747 for more information. |
348 # See https://github.com/csound/csound/issues/747 for more information. |
347 'format specifiers': [ |
349 'format specifiers': [ |
348 (r'%[#0\- +]*\d*(?:\.\d+)?[diuoxXfFeEgGaAcs]', String.Interpol), |
350 (r'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]', String.Interpol), |
349 (r'%%', String.Escape) |
351 (r'%%', String.Escape) |
350 ], |
352 ], |
351 |
353 |
352 'goto argument': [ |
354 'goto argument': [ |
353 include('whitespace and macro uses'), |
355 include('whitespace and macro uses'), |