/usr/lib/nodejs/highlight/lisp.js is in node-highlight 7.4+ds-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | module.exports = function(hljs) {
var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*';
var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
var SHEBANG = {
className: 'shebang',
begin: '^#!', end: '$'
};
var LITERAL = {
className: 'literal',
begin: '\\b(t{1}|nil)\\b'
};
var NUMBERS = [
{
className: 'number', begin: LISP_SIMPLE_NUMBER_RE
},
{
className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
},
{
className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
},
{
className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
},
{
className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
}
]
var STRING = {
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
};
var COMMENT = {
className: 'comment',
begin: ';', end: '$'
};
var VARIABLE = {
className: 'variable',
begin: '\\*', end: '\\*'
};
var KEYWORD = {
className: 'keyword',
begin: '[:&]' + LISP_IDENT_RE
};
var QUOTED_LIST = {
begin: '\\(', end: '\\)',
contains: ['self', LITERAL, STRING].concat(NUMBERS)
};
var QUOTED1 = {
className: 'quoted',
begin: '[\'`]\\(', end: '\\)',
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
};
var QUOTED2 = {
className: 'quoted',
begin: '\\(quote ', end: '\\)',
keywords: {title: 'quote'},
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
};
var LIST = {
className: 'list',
begin: '\\(', end: '\\)'
};
var BODY = {
endsWithParent: true,
relevance: 0
};
LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
return {
illegal: '[^\\s]',
contains: NUMBERS.concat([
SHEBANG,
LITERAL,
STRING,
COMMENT,
QUOTED1, QUOTED2,
LIST
])
};
};
|