source: node_modules/refractor/lang/oz.js

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

Initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1'use strict'
2
3module.exports = oz
4oz.displayName = 'oz'
5oz.aliases = []
6function oz(Prism) {
7 Prism.languages.oz = {
8 comment: {
9 pattern: /\/\*[\s\S]*?\*\/|%.*/,
10 greedy: true
11 },
12 string: {
13 pattern: /"(?:[^"\\]|\\[\s\S])*"/,
14 greedy: true
15 },
16 atom: {
17 pattern: /'(?:[^'\\]|\\[\s\S])*'/,
18 greedy: true,
19 alias: 'builtin'
20 },
21 keyword:
22 /\$|\[\]|\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/,
23 function: [
24 /\b[a-z][A-Za-z\d]*(?=\()/,
25 {
26 pattern: /(\{)[A-Z][A-Za-z\d]*\b/,
27 lookbehind: true
28 }
29 ],
30 number:
31 /\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,
32 variable: /`(?:[^`\\]|\\.)+`/,
33 'attr-name': /\b\w+(?=[ \t]*:(?![:=]))/,
34 operator:
35 /:(?:=|::?)|<[-:=]?|=(?:=|<?:?)|>=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,
36 punctuation: /[\[\](){}.:;?]/
37 }
38}
Note: See TracBrowser for help on using the repository browser.