prism-lolcode.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Prism.languages.lolcode = {
  2. 'comment': [
  3. /\bOBTW\s[\s\S]*?\sTLDR\b/,
  4. /\bBTW.+/
  5. ],
  6. 'string': {
  7. pattern: /"(?::.|[^":])*"/,
  8. inside: {
  9. 'variable': /:\{[^}]+\}/,
  10. 'symbol': [
  11. /:\([a-f\d]+\)/i,
  12. /:\[[^\]]+\]/,
  13. /:[)>o":]/
  14. ]
  15. },
  16. greedy: true
  17. },
  18. 'number': /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,
  19. 'symbol': {
  20. pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,
  21. lookbehind: true,
  22. inside: {
  23. 'keyword': /A(?=\s)/
  24. }
  25. },
  26. 'label': {
  27. pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
  28. lookbehind: true,
  29. alias: 'string'
  30. },
  31. 'function': {
  32. pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,
  33. lookbehind: true
  34. },
  35. 'keyword': [
  36. {
  37. pattern: /(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/,
  38. lookbehind: true
  39. },
  40. /'Z(?=\s|,|$)/
  41. ],
  42. 'boolean': {
  43. pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,
  44. lookbehind: true
  45. },
  46. 'variable': {
  47. pattern: /(^|\s)IT(?=\s|,|$)/,
  48. lookbehind: true
  49. },
  50. 'operator': {
  51. pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,
  52. lookbehind: true
  53. },
  54. 'punctuation': /\.{3}|…|,|!/
  55. };