1 | Prism.languages.elm = {
|
2 | comment: /--.*|{-[\s\S]*?-}/,
|
3 | char: {
|
4 | pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,
|
5 | greedy: true
|
6 | },
|
7 | string: [
|
8 | {
|
9 |
|
10 | pattern: /"""[\s\S]*?"""/,
|
11 | greedy: true
|
12 | },
|
13 | {
|
14 | pattern: /"(?:[^\\"\r\n]|\\(?:[abfnrtv\\"]|\d+|x[0-9a-fA-F]+))*"/,
|
15 | greedy: true
|
16 | }
|
17 | ],
|
18 | import_statement: {
|
19 |
|
20 |
|
21 |
|
22 | pattern: /^\s*import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,
|
23 | inside: {
|
24 | keyword: /\b(?:import|as|exposing)\b/
|
25 | }
|
26 | },
|
27 | keyword: /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,
|
28 |
|
29 | builtin: /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,
|
30 |
|
31 | number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | operator: /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,
|
40 |
|
41 | hvariable: /\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,
|
42 | constant: /\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,
|
43 | punctuation: /[{}[\]|(),.:]/
|
44 | };
|