prism-supercollider.js 989 B

123456789101112131415161718192021222324252627282930313233343536
  1. Prism.languages.supercollider = {
  2. 'comment': {
  3. pattern: /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,
  4. greedy: true
  5. },
  6. 'string': {
  7. pattern: /(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/,
  8. lookbehind: true,
  9. greedy: true
  10. },
  11. 'char': {
  12. pattern: /\$(?:[^\\\r\n]|\\.)/,
  13. greedy: true
  14. },
  15. 'symbol': {
  16. pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/,
  17. lookbehind: true,
  18. greedy: true
  19. },
  20. 'keyword': /\b(?:_|arg|classvar|const|nil|var|while)\b/,
  21. 'boolean': /\b(?:false|true)\b/,
  22. 'label': {
  23. pattern: /\b[a-z_]\w*(?=\s*:)/,
  24. alias: 'property'
  25. },
  26. 'number': /\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/,
  27. 'class-name': /\b[A-Z]\w*\b/,
  28. 'operator': /\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/,
  29. 'punctuation': /[{}()[\].:,;]|#[[{]/
  30. };
  31. Prism.languages.sclang = Prism.languages.supercollider;