discourse/vendor/assets/javascripts/highlightjs/languages/lisp.min.js

1 line
1.2 KiB
JavaScript

hljs.registerLanguage("lisp",function(){"use strict";return function(e){var n="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*",i="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?",a={className:"literal",begin:"\\b(t{1}|nil)\\b"},s={className:"number",variants:[{begin:i,relevance:0},{begin:"#(b|B)[0-1]+(/[0-1]+)?"},{begin:"#(o|O)[0-7]+(/[0-7]+)?"},{begin:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{begin:"#(c|C)\\("+i+" +"+i,end:"\\)"}]},b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),g=e.COMMENT(";","$",{relevance:0}),l={begin:"\\*",end:"\\*"},t={className:"symbol",begin:"[:&]"+n},r={begin:n,relevance:0},c={contains:[s,b,l,t,{begin:"\\(",end:"\\)",contains:["self",a,b,s,r]},r],variants:[{begin:"['`]\\(",end:"\\)"},{begin:"\\(quote ",end:"\\)",keywords:{name:"quote"}},{begin:"'\\|[^]*?\\|"}]},d={variants:[{begin:"'"+n},{begin:"#'"+n+"(::"+n+")*"}]},o={begin:"\\(\\s*",end:"\\)"},u={endsWithParent:!0,relevance:0};return o.contains=[{className:"name",variants:[{begin:n},{begin:"\\|[^]*?\\|"}]},u],u.contains=[c,d,o,a,s,b,g,l,t,{begin:"\\|[^]*?\\|"},r],{name:"Lisp",illegal:/\S/,contains:[s,e.SHEBANG(),a,b,g,c,d,o,r]}}}());