prism-apl.js 894 B

1234567891011121314151617181920212223242526272829303132
  1. Prism.languages.apl = {
  2. 'comment': /(?:⍝|#[! ]).*$/m,
  3. 'string': {
  4. pattern: /'(?:[^'\r\n]|'')*'/,
  5. greedy: true
  6. },
  7. 'number': /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,
  8. 'statement': /:[A-Z][a-z][A-Za-z]*\b/,
  9. 'system-function': {
  10. pattern: /⎕[A-Z]+/i,
  11. alias: 'function'
  12. },
  13. 'constant': /[⍬⌾#⎕⍞]/,
  14. 'function': /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
  15. 'monadic-operator': {
  16. pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
  17. alias: 'operator'
  18. },
  19. 'dyadic-operator': {
  20. pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/,
  21. alias: 'operator'
  22. },
  23. 'assignment': {
  24. pattern: /←/,
  25. alias: 'keyword'
  26. },
  27. 'punctuation': /[\[;\]()◇⋄]/,
  28. 'dfn': {
  29. pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
  30. alias: 'builtin'
  31. }
  32. };