-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshBrushLisp.js
27 lines (25 loc) · 1.19 KB
/
shBrushLisp.js
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
/* Highlighter for Lisp */
/*
* This was pulled from https://github.com/knuthaug/sh-lisp.
*
* TODO: Integrate knuthaug's symbol extraction script into 'build' process
*
* */
SyntaxHighlighter.brushes.Lisp = function ()
{
var funcs = 'lambda list progn mapcar car cdr reverse member append format';
var keywords = 'let while unless cond if eq t nil defvar dotimes setf listp numberp not equal';
var macros = 'loop when dolist dotimes defun';
var operators = '> < + - = * / %';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: new RegExp('&\\w+;', 'g'), css: 'plain' },
{ regex: new RegExp(';.*', 'g'), css: 'comments' },
{ regex: new RegExp("'(\\w|-)+", 'g'), css: 'variable' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(macros), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' }
];
};
SyntaxHighlighter.brushes.Lisp.prototype = new SyntaxHighlighter.Highlighter ();
SyntaxHighlighter.brushes.Lisp.aliases = ['lisp', 'clisp', 'elisp', 'emacs-lisp','clojure', 'scheme'];