From 008c19853edbb407f7a2fc9ca1b258ac2ea6cacc Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Mon, 7 Dec 2009 11:31:54 +0100 Subject: Improve Lisp code formatting. Ignore-this: f96ac0489c4112f19593926de51bd38b darcs-hash:ec7b2ec30f76e5d769941b576fdf2cec62c2c4db --- prettify/lang-lisp.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'prettify') 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']); -- cgit v1.2.3