prism-oz.js 906 B

12345678910111213141516171819202122232425
  1. Prism.languages.oz = {
  2. 'comment': /\/\*[\s\S]*?\*\/|%.*/,
  3. 'string': {
  4. pattern: /"(?:[^"\\]|\\[\s\S])*"/,
  5. greedy: true
  6. },
  7. 'atom': {
  8. pattern: /'(?:[^'\\]|\\[\s\S])*'/,
  9. greedy: true,
  10. alias: 'builtin'
  11. },
  12. 'keyword': /\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,
  13. 'function': [
  14. /\b[a-z][A-Za-z\d]*(?=\()/,
  15. {
  16. pattern: /(\{)[A-Z][A-Za-z\d]*\b/,
  17. lookbehind: true
  18. }
  19. ],
  20. 'number': /\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,
  21. 'variable': /\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/,
  22. 'attr-name': /\w+(?=:)/,
  23. 'operator': /:(?:=|::?)|<[-:=]?|=(?:=|<?:?)|>=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,
  24. 'punctuation': /[\[\](){}.:;?]/
  25. };