summaryrefslogtreecommitdiff
path: root/prettify
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-12-07 11:31:54 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-12-07 11:31:54 +0100
commit008c19853edbb407f7a2fc9ca1b258ac2ea6cacc (patch)
treedadb390296fe00e45f98439afc2cf28022c7cdac /prettify
parent461b8201f27b6c3a5b0e5a24ee0033ed155ee4c3 (diff)
Improve Lisp code formatting.
Ignore-this: f96ac0489c4112f19593926de51bd38b darcs-hash:ec7b2ec30f76e5d769941b576fdf2cec62c2c4db
Diffstat (limited to 'prettify')
-rw-r--r--prettify/lang-lisp.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/prettify/lang-lisp.js b/prettify/lang-lisp.js
index 4cffa53..49c05ee 100644
--- a/prettify/lang-lisp.js
+++ b/prettify/lang-lisp.js
@@ -67,8 +67,8 @@
PR.registerLangHandler(
PR.createSimpleLexer(
[
- ['opn', /^\(/, null, '('],
- ['clo', /^\)/, null, ')'],
+ ['opn', /^\(|\[/, null, ''],
+ ['clo', /^\)|\]/, null, ''],
// A line comment that starts with ;
[PR.PR_COMMENT, /^;[^\r\n]*/, null, ';'],
// Whitespace
@@ -77,17 +77,17 @@ PR.registerLangHandler(
[PR.PR_STRING, /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
],
[
- [PR.PR_KEYWORD, /^(?:block|c[ad]+r|catch|cons|defun|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, null],
+ [PR.PR_KEYWORD, /^(?:block|c[ad]+r|catch|cons|defun|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind|loop|with--*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?\b|define--*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?\b|for|in|from|to|fn|defn|def)/, null],
[PR.PR_LITERAL,
/^[+\-]?(?:0x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],
- // A single quote possibly followed by a word that optionally ends with
+ // A single quote or a colon possibly followed by a word that optionally ends with
// = ! or ?.
[PR.PR_LITERAL,
- /^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
+ /^(\'|\:)(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
// A word that optionally ends with = ! or ?.
[PR.PR_PLAIN,
/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],
// A printable non-space non-special character
- [PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0()\"\\\';]+/]
+ [PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0\"\\\';]+/]
]),
['cl', 'el', 'lisp', 'scm']);