prism-lolcode.js 1.3 KB

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