UNPKG

939 BJavaScriptView Raw
1Prism.languages.oz = {
2 'comment': {
3 pattern: /\/\*[\s\S]*?\*\/|%.*/,
4 greedy: true
5 },
6 'string': {
7 pattern: /"(?:[^"\\]|\\[\s\S])*"/,
8 greedy: true
9 },
10 'atom': {
11 pattern: /'(?:[^'\\]|\\[\s\S])*'/,
12 greedy: true,
13 alias: 'builtin'
14 },
15 'keyword': /\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,
16 'function': [
17 /\b[a-z][A-Za-z\d]*(?=\()/,
18 {
19 pattern: /(\{)[A-Z][A-Za-z\d]*\b/,
20 lookbehind: true
21 }
22 ],
23 'number': /\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,
24 'variable': /`(?:[^`\\]|\\.)+`/,
25 'attr-name': /\b\w+(?=[ \t]*:(?![:=]))/,
26 'operator': /:(?:=|::?)|<[-:=]?|=(?:=|<?:?)|>=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,
27 'punctuation': /[\[\](){}.:;?]/
28};