-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
lolcode.js
57 lines (56 loc) · 1.65 KB
/
lolcode.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// @ts-nocheck
lolcode.displayName = 'lolcode'
lolcode.aliases = []
/** @type {import('../core.js').Syntax} */
export default function lolcode(Prism) {
Prism.languages.lolcode = {
comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/],
string: {
pattern: /"(?::.|[^":])*"/,
inside: {
variable: /:\{[^}]+\}/,
symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/]
},
greedy: true
},
number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,
symbol: {
pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,
lookbehind: true,
inside: {
keyword: /A(?=\s)/
}
},
label: {
pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
lookbehind: true,
alias: 'string'
},
function: {
pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,
lookbehind: true
},
keyword: [
{
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|,|$)/,
lookbehind: true
},
/'Z(?=\s|,|$)/
],
boolean: {
pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,
lookbehind: true
},
variable: {
pattern: /(^|\s)IT(?=\s|,|$)/,
lookbehind: true
},
operator: {
pattern:
/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,
lookbehind: true
},
punctuation: /\.{3}|…|,|!/
}
}