source: node_modules/refractor/lang/lolcode.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[d24f17c]1'use strict'
2
3module.exports = lolcode
4lolcode.displayName = 'lolcode'
5lolcode.aliases = []
6function lolcode(Prism) {
7 Prism.languages.lolcode = {
8 comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/],
9 string: {
10 pattern: /"(?::.|[^":])*"/,
11 inside: {
12 variable: /:\{[^}]+\}/,
13 symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/]
14 },
15 greedy: true
16 },
17 number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,
18 symbol: {
19 pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\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)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,
32 lookbehind: true
33 },
34 keyword: [
35 {
36 pattern:
37 /(^|\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:
52 /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,
53 lookbehind: true
54 },
55 punctuation: /\.{3}|…|,|!/
56 }
57}
Note: See TracBrowser for help on using the repository browser.