1 | Prism.languages.julia = {
|
2 | 'comment': {
|
3 |
|
4 |
|
5 | pattern: /(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,
|
6 | lookbehind: true
|
7 | },
|
8 | 'regex': {
|
9 |
|
10 | pattern: /r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,
|
11 | greedy: true
|
12 | },
|
13 | 'string': {
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | pattern: /"""[\s\S]+?"""|\w*"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'|`(?:[^\\`\r\n]|\\.)*`/,
|
19 | lookbehind: true,
|
20 | greedy: true
|
21 | },
|
22 | 'keyword': /\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,
|
23 | 'boolean': /\b(?:true|false)\b/,
|
24 | 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*\.?(?:\d+(?:_\d+)*)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,
|
25 |
|
26 |
|
27 | 'operator': /&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,
|
28 | 'punctuation': /::?|[{}[\]();,.?]/,
|
29 |
|
30 | 'constant': /\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi|e|catalan|eulergamma|golden)\b|[πℯγφ]/
|
31 | };
|