prism-erlang.js 799 B

1234567891011121314151617181920212223242526272829303132333435
  1. Prism.languages.erlang = {
  2. 'comment': /%.+/,
  3. 'string': /"(?:\\?.)*?"/,
  4. 'quoted-function': {
  5. pattern: /'[^']+'(?=\()/,
  6. alias: 'function'
  7. },
  8. 'quoted-atom': {
  9. pattern: /'[^']+'/,
  10. alias: 'atom'
  11. },
  12. 'boolean': /\b(?:true|false)\b/,
  13. 'keyword': /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,
  14. 'number': [
  15. /\$\\?./,
  16. /\d+#[a-z0-9]+/i,
  17. /(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/
  18. ],
  19. 'function': /\b[a-z][\w@]*(?=\()/,
  20. 'variable': /(?:\b|\?)[A-Z_][\w@]*/,
  21. 'operator': [
  22. /[=\/>:]=|>=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,
  23. {
  24. pattern: /(^|(?!<).)<(?!<)/,
  25. lookbehind: true
  26. },
  27. {
  28. pattern: /(^|(?!>).)>(?!>)/,
  29. lookbehind: true
  30. }
  31. ],
  32. 'atom': /\b[a-z][\w@]*/,
  33. 'punctuation': /[()[\]{}:;,.#|]|<<|>>/
  34. };