]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/lisp.js
1 /*! `lisp` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Generic lisp syntax
9 Author: Vasily Polovnyov <vast@whiteants.net>
14 const LISP_IDENT_RE
= '[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*';
15 const MEC_RE
= '\\|[^]*?\\|';
16 const LISP_SIMPLE_NUMBER_RE
= '(-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|-)?\\d+)?';
19 begin: '\\b(t{1}|nil)\\b'
25 begin: LISP_SIMPLE_NUMBER_RE
,
28 { begin: '#(b|B)[0-1]+(/[0-1]+)?' },
29 { begin: '#(o|O)[0-7]+(/[0-7]+)?' },
30 { begin: '#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?' },
32 begin: '#(c|C)\\(' + LISP_SIMPLE_NUMBER_RE
+ ' +' + LISP_SIMPLE_NUMBER_RE
,
37 const STRING
= hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { illegal: null });
38 const COMMENT
= hljs
.COMMENT(
48 begin: '[:&]' + LISP_IDENT_RE
54 const MEC
= { begin: MEC_RE
};
83 keywords: { name: 'quote' }
85 { begin: '\'' + MEC_RE
}
88 const QUOTED_ATOM
= { variants: [
89 { begin: '\'' + LISP_IDENT_RE
},
90 { begin: '#\'' + LISP_IDENT_RE
+ '(::' + LISP_IDENT_RE
+ ')*' }
105 begin: LISP_IDENT_RE
,
148 hljs
.registerLanguage('lisp', hljsGrammar
);