/usr/lib/nodejs/highlight/clojure.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 85 86 87 88 89 90 91 92 93 94 95 | module.exports = function(hljs) {
var keywords = {
built_in:
// Clojure keywords
'def cond apply if-not if-let if not not= = < < > <= <= >= == + / * - rem '+
'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? '+
'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? '+
'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? '+
'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . '+
'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last '+
'drop-while while intern condp case reduced cycle split-at split-with repeat replicate '+
'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext '+
'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends '+
'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler '+
'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter '+
'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for doseq dosync dotimes and or '+
'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert '+
'peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast '+
'sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import '+
'intern refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+
'assoc! dissoc! pop! disj! import use class type num float double short byte boolean bigint biginteger '+
'bigdec print-method print-dup throw-if throw printf format load compile get-in update-in pr pr-on newline '+
'flush read slurp read-line subvec with-open memfn time ns assert re-find re-groups rand-int rand mod locking '+
'assert-valid-fdecl alias namespace resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+
'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! '+
'new next conj set! memfn to-array future future-call into-array aset gen-class reduce merge map filter find empty '+
'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list '+
'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer '+
'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate '+
'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta '+
'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize'
};
var CLJ_IDENT_RE = '[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$\';]+';
var SIMPLE_NUMBER_RE = '[\\s:\\(\\{]+\\d+(\\.\\d+)?';
var NUMBER = {
className: 'number', begin: SIMPLE_NUMBER_RE,
relevance: 0
};
var STRING = {
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
};
var COMMENT = {
className: 'comment',
begin: ';', end: '$',
relevance: 0
};
var COLLECTION = {
className: 'collection',
begin: '[\\[\\{]', end: '[\\]\\}]'
};
var HINT = {
className: 'comment',
begin: '\\^' + CLJ_IDENT_RE
};
var HINT_COL = {
className: 'comment',
begin: '\\^\\{', end: '\\}'
};
var KEY = {
className: 'attribute',
begin: '[:]' + CLJ_IDENT_RE
};
var LIST = {
className: 'list',
begin: '\\(', end: '\\)'
};
var BODY = {
endsWithParent: true,
keywords: {literal: 'true false nil'},
relevance: 0
};
var TITLE = {
keywords: keywords,
lexems: CLJ_IDENT_RE,
className: 'title', begin: CLJ_IDENT_RE,
starts: BODY
};
LIST.contains = [{className: 'comment', begin: 'comment'}, TITLE];
BODY.contains = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER];
COLLECTION.contains = [LIST, STRING, HINT, COMMENT, KEY, COLLECTION, NUMBER];
return {
illegal: '\\S',
contains: [
COMMENT,
LIST
]
}
};
|