prism-j.js 966 B

12345678910111213141516171819202122232425
  1. Prism.languages.j = {
  2. 'comment': /\bNB\..*/,
  3. 'string': {
  4. pattern: /'(?:''|[^'\r\n])*'/,
  5. greedy: true
  6. },
  7. 'keyword': /\b(?:(?:adverb|conjunction|CR|def|define|dyad|LF|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,
  8. 'verb': {
  9. // Negative look-ahead prevents bad highlighting
  10. // of ^: ;. =. =: !. !:
  11. pattern: /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,
  12. alias: 'keyword'
  13. },
  14. 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,
  15. 'adverb': {
  16. pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,
  17. alias: 'builtin'
  18. },
  19. 'operator': /[=a][.:]|_\./,
  20. 'conjunction': {
  21. pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,
  22. alias: 'variable'
  23. },
  24. 'punctuation': /[()]/
  25. };