source: node_modules/refractor/lang/erlang.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.3 KB
Line 
1'use strict'
2
3module.exports = erlang
4erlang.displayName = 'erlang'
5erlang.aliases = []
6function erlang(Prism) {
7 Prism.languages.erlang = {
8 comment: /%.+/,
9 string: {
10 pattern: /"(?:\\.|[^\\"\r\n])*"/,
11 greedy: true
12 },
13 'quoted-function': {
14 pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/,
15 alias: 'function'
16 },
17 'quoted-atom': {
18 pattern: /'(?:\\.|[^\\'\r\n])+'/,
19 alias: 'atom'
20 },
21 boolean: /\b(?:false|true)\b/,
22 keyword: /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/,
23 number: [
24 /\$\\?./,
25 /\b\d+#[a-z0-9]+/i,
26 /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i
27 ],
28 function: /\b[a-z][\w@]*(?=\()/,
29 variable: {
30 // Look-behind is used to prevent wrong highlighting of atoms containing "@"
31 pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,
32 lookbehind: true
33 },
34 operator: [
35 /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,
36 {
37 // We don't want to match <<
38 pattern: /(^|[^<])<(?!<)/,
39 lookbehind: true
40 },
41 {
42 // We don't want to match >>
43 pattern: /(^|[^>])>(?!>)/,
44 lookbehind: true
45 }
46 ],
47 atom: /\b[a-z][\w@]*/,
48 punctuation: /[()[\]{}:;,.#|]|<<|>>/
49 }
50}
Note: See TracBrowser for help on using the repository browser.