erlang-repl.js (1237B)
1 /* 2 Language: Erlang REPL 3 Author: Sergey Ignatov <sergey@ignatov.spb.su> 4 Website: https://www.erlang.org 5 Category: functional 6 */ 7 8 function erlangRepl(hljs) { 9 return { 10 name: 'Erlang REPL', 11 keywords: { 12 built_in: 13 'spawn spawn_link self', 14 keyword: 15 'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' + 16 'let not of or orelse|10 query receive rem try when xor' 17 }, 18 contains: [ 19 { 20 className: 'meta', begin: '^[0-9]+> ', 21 relevance: 10 22 }, 23 hljs.COMMENT('%', '$'), 24 { 25 className: 'number', 26 begin: '\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)', 27 relevance: 0 28 }, 29 hljs.APOS_STRING_MODE, 30 hljs.QUOTE_STRING_MODE, 31 { 32 begin: '\\?(::)?([A-Z]\\w*(::)?)+' 33 }, 34 { 35 begin: '->' 36 }, 37 { 38 begin: 'ok' 39 }, 40 { 41 begin: '!' 42 }, 43 { 44 begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)', 45 relevance: 0 46 }, 47 { 48 begin: '[A-Z][a-zA-Z0-9_\']*', 49 relevance: 0 50 } 51 ] 52 }; 53 } 54 55 module.exports = erlangRepl;