Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to 7.1

  • Loading branch information...
commit 7d6da30689bbe240a123abd9f85c756ca524d71f 1 parent c48a19b
@chloerei authored
Showing with 4,180 additions and 2,386 deletions.
  1. +20 −2 AUTHORS.en.txt
  2. +20 −2 AUTHORS.ru.txt
  3. +122 −6 classref.txt
  4. BIN  vendor/assets/images/highlight_js/pojoaque.jpg
  5. +116 −80 vendor/assets/javascripts/highlight_js/highlight.js
  6. +34 −8 vendor/assets/javascripts/highlight_js/languages/1c.js
  7. +85 −0 vendor/assets/javascripts/highlight_js/languages/actionscript.js
  8. +96 −409 vendor/assets/javascripts/highlight_js/languages/apache.js
  9. +53 −66 vendor/assets/javascripts/highlight_js/languages/avrasm.js
  10. +41 −38 vendor/assets/javascripts/highlight_js/languages/axapta.js
  11. +19 −16 vendor/assets/javascripts/highlight_js/languages/bash.js
  12. +105 −0 vendor/assets/javascripts/highlight_js/languages/clojure.js
  13. +33 −17 vendor/assets/javascripts/highlight_js/languages/cmake.js
  14. +112 −0 vendor/assets/javascripts/highlight_js/languages/coffeescript.js
  15. +26 −37 vendor/assets/javascripts/highlight_js/languages/cpp.js
  16. +46 −34 vendor/assets/javascripts/highlight_js/languages/cs.js
  17. +6 −9 vendor/assets/javascripts/highlight_js/languages/css.js
  18. +269 −0 vendor/assets/javascripts/highlight_js/languages/d.js
  19. +20 −11 vendor/assets/javascripts/highlight_js/languages/delphi.js
  20. +60 −58 vendor/assets/javascripts/highlight_js/languages/diff.js
  21. +23 −5 vendor/assets/javascripts/highlight_js/languages/django.js
  22. +31 −23 vendor/assets/javascripts/highlight_js/languages/dos.js
  23. +52 −76 vendor/assets/javascripts/highlight_js/languages/erlang-repl.js
  24. +27 −64 vendor/assets/javascripts/highlight_js/languages/erlang.js
  25. +101 −0 vendor/assets/javascripts/highlight_js/languages/glsl.js
  26. +14 −25 vendor/assets/javascripts/highlight_js/languages/go.js
  27. +34 −21 vendor/assets/javascripts/highlight_js/languages/haskell.js
  28. +41 −0 vendor/assets/javascripts/highlight_js/languages/http.js
  29. +30 −28 vendor/assets/javascripts/highlight_js/languages/ini.js
  30. +46 −40 vendor/assets/javascripts/highlight_js/languages/java.js
  31. +55 −49 vendor/assets/javascripts/highlight_js/languages/javascript.js
  32. +44 −0 vendor/assets/javascripts/highlight_js/languages/json.js
  33. +27 −26 vendor/assets/javascripts/highlight_js/languages/lisp.js
  34. +31 −39 vendor/assets/javascripts/highlight_js/languages/lua.js
  35. +87 −0 vendor/assets/javascripts/highlight_js/languages/markdown.js
  36. +64 −0 vendor/assets/javascripts/highlight_js/languages/matlab.js
  37. +232 −34 vendor/assets/javascripts/highlight_js/languages/mel.js
  38. +85 −207 vendor/assets/javascripts/highlight_js/languages/nginx.js
  39. +33 −37 vendor/assets/javascripts/highlight_js/languages/objectivec.js
  40. +10 −10 vendor/assets/javascripts/highlight_js/languages/parser3.js
  41. +50 −22 vendor/assets/javascripts/highlight_js/languages/perl.js
  42. +106 −49 vendor/assets/javascripts/highlight_js/languages/php.js
  43. +44 −42 vendor/assets/javascripts/highlight_js/languages/profile.js
  44. +59 −46 vendor/assets/javascripts/highlight_js/languages/python.js
  45. +82 −0 vendor/assets/javascripts/highlight_js/languages/r.js
  46. +0 −230 vendor/assets/javascripts/highlight_js/languages/renderman.js
  47. +34 −0 vendor/assets/javascripts/highlight_js/languages/rib.js
  48. +46 −0 vendor/assets/javascripts/highlight_js/languages/rsl.js
  49. +96 −107 vendor/assets/javascripts/highlight_js/languages/ruby.js
  50. +62 −0 vendor/assets/javascripts/highlight_js/languages/rust.js
  51. +10 −7 vendor/assets/javascripts/highlight_js/languages/scala.js
  52. +3 −3 vendor/assets/javascripts/highlight_js/languages/smalltalk.js
  53. +61 −85 vendor/assets/javascripts/highlight_js/languages/sql.js
  54. +4 −6 vendor/assets/javascripts/highlight_js/languages/tex.js
  55. +62 −68 vendor/assets/javascripts/highlight_js/languages/vala.js
  56. +41 −23 vendor/assets/javascripts/highlight_js/languages/vbscript.js
  57. +45 −24 vendor/assets/javascripts/highlight_js/languages/vhdl.js
  58. +13 −9 vendor/assets/javascripts/highlight_js/languages/xml.js
  59. +15 −11 vendor/assets/stylesheets/highlight_js/arta.css
  60. +8 −3 vendor/assets/stylesheets/highlight_js/ascetic.css
  61. +11 −14 vendor/assets/stylesheets/highlight_js/{brown_paper.css.erb → brown_paper.scss}
  62. +10 −12 vendor/assets/stylesheets/highlight_js/dark.css
  63. +27 −16 vendor/assets/stylesheets/highlight_js/default.css
  64. +14 −21 vendor/assets/stylesheets/highlight_js/far.css
  65. +14 −12 vendor/assets/stylesheets/highlight_js/github.css
  66. +144 −0 vendor/assets/stylesheets/highlight_js/googlecode.css
  67. +7 −4 vendor/assets/stylesheets/highlight_js/idea.css
  68. +9 −14 vendor/assets/stylesheets/highlight_js/ir_black.css
  69. +8 −7 vendor/assets/stylesheets/highlight_js/magula.css
  70. +112 −0 vendor/assets/stylesheets/highlight_js/monokai.css
  71. +104 −0 vendor/assets/stylesheets/highlight_js/pojoaque.scss
  72. +114 −0 vendor/assets/stylesheets/highlight_js/rainbow.css
  73. +11 −13 vendor/assets/stylesheets/highlight_js/{school_book.css.erb → school_book.scss}
  74. +10 −18 vendor/assets/stylesheets/highlight_js/solarized_dark.css
  75. +10 −18 vendor/assets/stylesheets/highlight_js/solarized_light.css
  76. +8 −7 vendor/assets/stylesheets/highlight_js/sunburst.css
  77. +42 −0 vendor/assets/stylesheets/highlight_js/tomorrow-night-blue.css
  78. +41 −0 vendor/assets/stylesheets/highlight_js/tomorrow-night-bright.css
  79. +41 −0 vendor/assets/stylesheets/highlight_js/tomorrow-night-eighties.css
  80. +42 −0 vendor/assets/stylesheets/highlight_js/tomorrow-night.css
  81. +39 −0 vendor/assets/stylesheets/highlight_js/tomorrow.css
  82. +8 −7 vendor/assets/stylesheets/highlight_js/vs.css
  83. +154 −0 vendor/assets/stylesheets/highlight_js/xcode.css
  84. +9 −11 vendor/assets/stylesheets/highlight_js/zenburn.css
View
22 AUTHORS.en.txt
@@ -21,7 +21,7 @@ Contributors:
- MajestiC <majestic2k@gmail.com>
- Vasily Polovnyov <vast@whiteants.net>
- Vladimir Epifanov <voldmar@voldmar.ru>
-- Alexander Makarov (http://rmcreative.ru/)
+- Alexander Makarov <sam@rmcreative.ru>
- Vah <vahtenberg@gmail.com>
- Shuen-Huei Guan <drake.guan@gmail.com>
- Jason Diamond <jason@diamond.name>
@@ -35,7 +35,7 @@ Contributors:
- Vladimir Moskva <vladmos@gmail.com>
- Loren Segal <lsegal@soen.ca>
- Andrew Fedorov <dmmdrs@mail.ru>
-- Igor Kalnitsky <igor.kalnitsky@gmail.com>
+- Igor Kalnitsky <igor@kalnitsky.org>
- Jeremy Hull <sourdrums@gmail.com>
- Valerii Hiora <valerii.hiora@gmail.com>
- Nikolay Zakharov <nikolay.desh@gmail.com>
@@ -44,3 +44,21 @@ Contributors:
- Antono Vasiljev <self@antono.info>
- Stephan Kountso <steplg@gmail.com>
- pumbur <pumbur@pumbur.net>
+- John Crepezzi <john.crepezzi@gmail.com>
+- Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
+- Alexander Myadzel <myadzel@gmail.com>
+- Evgeny Stepanischev <imbolk@gmail.com>
+- Dmytrii Nagirniak <dnagir@gmail.com>
+- Oleg Efimov <efimovov@gmail.com>
+- Luigi Maselli <grigio.org@gmail.com>
+- Denis Bardadym <bardadymchik@gmail.com>
+- Aahan Krish <geekpanth3r@gmail.com>
+- Ilya Baryshev <baryshev@gmail.com>
+- Aleksandar Ruzicic <aleksandar@ruzicic.info>
+- Joe Cheng <joe@rstudio.org>
+- Angel G. Olloqui <angelgarcia.mail@gmail.com>
+- Jason Tate <adminz@web-cms-designs.com>
+- Sergey Tikhomirov <me@stikhomirov.com>
+- Marc Fornos <marc.fornos@gmail.com>
+- Yoshihide Jimbo <yjimbo@gmail.com>
+- Casey Duncan <casey.duncan@gmail.com>
View
22 AUTHORS.ru.txt
@@ -21,7 +21,7 @@ URL: http://softwaremaniacs.org/soft/highlight/
- MajestiC <majestic2k@gmail.com>
- Василий Половнёв <vast@whiteants.net>
- Владимир Епифанов <voldmar@voldmar.ru>
-- Александр Макаров (http://rmcreative.ru/)
+- Александр Макаров <sam@rmcreative.ru>
- Vah <vahtenberg@gmail.com>
- Шуэн-Хуэй Гуан <drake.guan@gmail.com>
- Джейсон Даймонд <jason@diamond.name>
@@ -35,7 +35,7 @@ URL: http://softwaremaniacs.org/soft/highlight/
- Владимир Москва <vladmos@gmail.com>
- Лорен Сегал <lsegal@soen.ca>
- Андрей Фёдоров <dmmdrs@mail.ru>
-- Игорь Кальницкий <igor.kalnitsky@gmail.com>
+- Игорь Кальницкий <igor@kalnitsky.org>
- Джереми Халл <sourdrums@gmail.com>
- Валерий Хиора <valerii.hiora@gmail.com>
- Николай Захаров <nikolay.desh@gmail.com>
@@ -44,3 +44,21 @@ URL: http://softwaremaniacs.org/soft/highlight/
- Антоно Васильев <self@antono.info>
- Степан Кунцьо <steplg@gmail.com>
- pumbur <pumbur@pumbur.net>
+- Джон Крепецци <john.crepezzi@gmail.com>
+- Андрей Власовских <andrey.vlasovskikh@gmail.com>
+- Александр Мядзель <myadzel@gmail.com>
+- Евгений Степанищев <imbolk@gmail.com>
+- Дмитрий Нагирняк <dnagir@gmail.com>
+- Олег Ефимов <efimovov@gmail.com>
+- Луиджи Мазелли <grigio.org@gmail.com>
+- Денис Бардадым <bardadymchik@gmail.com>
+- Аахан Криш <geekpanth3r@gmail.com>
+- Илья Барышев <baryshev@gmail.com>
+- Александр Ружичич <aleksandar@ruzicic.info>
+- Джо Ченг <joe@rstudio.org>
+- Анхель Ойоки <angelgarcia.mail@gmail.com>
+- Джейсон Тейт <adminz@web-cms-designs.com>
+- Сергей Тихомиров <me@stikhomirov.com>
+- Марк Форнос <marc.fornos@gmail.com>
+- Йошихиде Джимбо <yjimbo@gmail.com>
+- Кейси Данкан <casey.duncan@gmail.com>
View
128 classref.txt
@@ -39,7 +39,6 @@ Ruby ("ruby"):
title name of a function or a class inside a header
parent name of a parent class
symbol symbol
- instancevar instance variable
Perl ("perl"):
@@ -124,6 +123,18 @@ CSS ("css"):
params everything between "(" and ")" within a function
important "!important" symbol
+Markdown ("markdown"):
+
+ header header
+ bullet list bullet
+ emphasis emphasis
+ strong strong emphasis
+ blockquote blockquote
+ code code
+ horizontal_rule horizontal rule
+ link_label link label
+ link_url link url
+
Django ("django"):
keyword HTML tag in HTML, default tags and default filters in templates
@@ -138,7 +149,15 @@ Django ("django"):
filter filter from "|" till the next filter or the end of tag
argument filter argument
-Javascript ("javascript"):
+JSON ("json"):
+
+ number number
+ literal "true", "false" and "null"
+ string string value
+ attribute name of an object property
+ value value of an object property
+
+JavaScript ("javascript"):
keyword keyword
comment comment
@@ -148,7 +167,36 @@ Javascript ("javascript"):
regexp regular expression
function header of a function
title name of a function inside a header
- params everything inside parentheses in a function's header
+ params parentheses and everything inside them in a function's header
+
+CoffeeScript ("coffeescript"):
+
+ keyword keyword
+ comment comment
+ number number
+ literal special literal: "true", "false" and "null"
+ string string
+ regexp regular expression
+ function header of a function
+ title name of a function variable inside a header
+ params parentheses and everything inside them in a function's header
+
+ActionScript ("actionscript"):
+
+ comment comment
+ string string
+ number number
+ keyword keywords
+ literal literal
+ reserved reserved keyword
+ title name of declaration (package, class or function)
+ preprocessor preprocessor directive (import, include)
+ type type of returned value (for functions)
+ package package (named or not)
+ class class/interface
+ function function
+ param params of function
+ rest_arg rest argument of function
VBScript ("vbscript"):
@@ -158,6 +206,14 @@ VBScript ("vbscript"):
comment comment
built_in built-in function
+HTTP ("http"):
+
+ request first line of a request
+ status first line of a response
+ attribute header name
+ string header value or query string in a request line
+ number status code
+
Lua ("lua"):
keyword keyword
@@ -212,6 +268,7 @@ Objective C ("objectivec"):
comment comment
preprocessor preprocessor directive
class interface/implementation, protocol and forward class declaration
+ variable properties and struct accesors
Vala ("vala"):
@@ -231,6 +288,15 @@ C# ("cs"):
comment commment
xmlDocTag xmldoc tag ("///", "<!--", "-->", "<..>")
+D language ("d"):
+
+ comment comment
+ string string constant
+ number number
+ keyword language keywords (including @attributes)
+ constant true false null
+ built_in built-in plain types (int, string etc.)
+
RenderMan RSL ("rsl"):
keyword keyword
@@ -291,6 +357,16 @@ Lisp ("lisp"):
body remainder of the non-quoted list
quoted quoted list, both "(quote .. )" and "'(..)"
+Clojure ("clojure"):
+
+ comment comments and hints
+ string string
+ number number
+ collection collections
+ attribute :keyword
+ title function name (built-in or user defined)
+ built_in built-in function name
+
Ini ("ini"):
title title of a section
@@ -311,12 +387,13 @@ Apache ("apache"):
Nginx ("nginx"):
- keyword keyword
+ title directive title
string string
number number
comment comment
built_in built-in constant
variable $-variable
+ regexp regexp
Diff ("diff"):
@@ -394,6 +471,8 @@ VHDL ("vhdl")
string string
comment commment
literal signal logical value
+ typename typename
+ attribute signal attribute
Parser3 ("parser3"):
@@ -416,13 +495,13 @@ TeX ("tex"):
Haskell ("haskell"):
keyword keyword
- built_in built-in typeclass/functions (Bool, Int)
number number
string string
comment comment
class type classes and other data types
title function name
- label type class name
+ type type class name
+ typedef definition of types (type, newtype, data)
Erlang ("erlang"):
@@ -435,3 +514,40 @@ Erlang ("erlang"):
variable variable (starts with capital letter or with _)
pp.keywords module's attribute (-attribute)
function_name atom or atom:atom in case of function call
+
+Rust ("rust"):
+
+ comment comment
+ string string
+ number number
+ keyword keyword
+ title name of declaration
+ preprocessor preprocessor directive
+
+Matlab ("matlab"):
+
+ comment comment
+ string string
+ number number
+ keyword keyword
+ title function name
+ function function
+ param params of function
+
+R ("r"):
+
+ comment comment
+ string string constant
+ number number
+ keyword language keywords (function, if) plus "structural"
+ functions (attach, require, setClass)
+ literal special literal: TRUE, FALSE, NULL, NA, etc.
+
+OpenGL Shading Language ("glsl"):
+
+ comment comment
+ number number
+ preprocessor preprocessor directive
+ keyword keyword
+ built_in GLSL built-in functions and variables
+ literal true false
View
BIN  vendor/assets/images/highlight_js/pojoaque.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
196 vendor/assets/javascripts/highlight_js/highlight.js
@@ -28,6 +28,8 @@ var hljs = new function() {
}
}
+ var is_old_IE = (typeof navigator !== 'undefined' && /MSIE [678]/.test(navigator.userAgent));
+
function blockText(block, ignoreNewLines) {
var result = '';
for (var i = 0; i < block.childNodes.length; i++)
@@ -40,14 +42,13 @@ var hljs = new function() {
result += '\n';
else
result += blockText(block.childNodes[i]);
- // Thank you, MSIE...
- if (/MSIE [678]/.test(navigator.userAgent))
+ if (is_old_IE)
result = result.replace(/\r/g, '\n');
return result;
}
function blockLanguage(block) {
- var classes = block.className.split(/\s+/)
+ var classes = block.className.split(/\s+/);
classes = classes.concat(block.parentNode.className.split(/\s+/));
for (var i = 0; i < classes.length; i++) {
var class_ = classes[i].replace(/^language-/, '');
@@ -61,19 +62,19 @@ var hljs = new function() {
function nodeStream(node) {
var result = [];
- (function (node, offset) {
+ (function _nodeStream(node, offset) {
for (var i = 0; i < node.childNodes.length; i++) {
if (node.childNodes[i].nodeType == 3)
offset += node.childNodes[i].nodeValue.length;
else if (node.childNodes[i].nodeName == 'BR')
- offset += 1
- else {
+ offset += 1;
+ else if (node.childNodes[i].nodeType == 1) {
result.push({
event: 'start',
offset: offset,
node: node.childNodes[i]
});
- offset = arguments.callee(node.childNodes[i], offset)
+ offset = _nodeStream(node.childNodes[i], offset);
result.push({
event: 'stop',
offset: offset,
@@ -123,8 +124,8 @@ var hljs = new function() {
for (var i = 0; i < node.attributes.length; i++) {
var attribute = node.attributes[i];
result += ' ' + attribute.nodeName.toLowerCase();
- if (attribute.nodeValue != undefined && attribute.nodeValue != false && attribute.nodeValue != null) {
- result += '="' + escape(attribute.nodeValue) + '"';
+ if (attribute.value !== undefined && attribute.value !== false && attribute.value !== null) {
+ result += '="' + escape(attribute.value) + '"';
}
}
return result + '>';
@@ -138,10 +139,10 @@ var hljs = new function() {
result += open(current.node);
nodeStack.push(current.node);
} else if (current.event == 'stop') {
- var i = nodeStack.length;
+ var node, i = nodeStack.length;
do {
i--;
- var node = nodeStack[i];
+ node = nodeStack[i];
result += ('</' + node.nodeName.toLowerCase() + '>');
} while (node != current.node);
nodeStack.splice(i, 1);
@@ -151,40 +152,56 @@ var hljs = new function() {
}
}
}
- result += value.substr(processed);
- return result;
+ return result + escape(value.substr(processed));
}
/* Initialization */
- function compileModes() {
+ function compileModes(language_name) {
function compileMode(mode, language, is_default) {
if (mode.compiled)
return;
+ var keywords = []; // used later with beginWithKeyword but filled as a side-effect of keywords compilation
+ if (mode.keywords) {
+ var compiled_keywords = {};
+
+ function flatten(className, str) {
+ var group = str.split(' ');
+ for (var i = 0; i < group.length; i++) {
+ var pair = group[i].split('|');
+ compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];
+ keywords.push(pair[0]);
+ }
+ }
+
+ mode.lexemsRe = langRe(language, mode.lexems || hljs.IDENT_RE, true);
+ if (typeof mode.keywords == 'string') { // string
+ flatten('keyword', mode.keywords)
+ } else {
+ for (var className in mode.keywords) {
+ if (!mode.keywords.hasOwnProperty(className))
+ continue;
+ flatten(className, mode.keywords[className]);
+ }
+ }
+ mode.keywords = compiled_keywords;
+ }
if (!is_default) {
+ if (mode.beginWithKeyword) {
+ mode.begin = '\\b(' + keywords.join('|') + ')\\s';
+ }
mode.beginRe = langRe(language, mode.begin ? mode.begin : '\\B|\\b');
if (!mode.end && !mode.endsWithParent)
- mode.end = '\\B|\\b'
+ mode.end = '\\B|\\b';
if (mode.end)
mode.endRe = langRe(language, mode.end);
}
if (mode.illegal)
mode.illegalRe = langRe(language, mode.illegal);
- if (mode.relevance == undefined)
+ if (mode.relevance === undefined)
mode.relevance = 1;
- if (mode.keywords)
- mode.lexemsRe = langRe(language, mode.lexems || hljs.IDENT_RE, true);
- for (var key in mode.keywords) {
- if (!mode.keywords.hasOwnProperty(key))
- continue;
- if (mode.keywords[key] instanceof Object)
- mode.keywordGroups = mode.keywords;
- else
- mode.keywordGroups = {'keyword': mode.keywords};
- break;
- }
if (!mode.contains) {
mode.contains = [];
}
@@ -192,20 +209,20 @@ var hljs = new function() {
// (see lisp where quoted_list contains quoted_list)
mode.compiled = true;
for (var i = 0; i < mode.contains.length; i++) {
+ if (mode.contains[i] == 'self') {
+ mode.contains[i] = mode;
+ }
compileMode(mode.contains[i], language, false);
}
if (mode.starts) {
compileMode(mode.starts, language, false);
}
}
-
- for (var i in languages) {
- if (!languages.hasOwnProperty(i))
- continue;
- compileMode(languages[i].defaultMode, languages[i], true);
- }
+ compileMode(languages[language_name].defaultMode, languages[language_name], true);
}
+ var compiled_languages = {};
+
/*
Core highlighting function. Accepts a language name and a string with the
code to highlight. Returns an object with the following properties:
@@ -216,14 +233,15 @@ var hljs = new function() {
*/
function highlight(language_name, value) {
- if (!compileModes.called) {
- compileModes();
- compileModes.called = true;
+ if (!compiled_languages[language_name]) {
+ compileModes(language_name);
+ compiled_languages[language_name] = true;
}
function subMode(lexem, mode) {
for (var i = 0; i < mode.contains.length; i++) {
- if (mode.contains[i].beginRe.test(lexem)) {
+ var match = mode.contains[i].beginRe.exec(lexem);
+ if (match && match.index == 0) {
return mode.contains[i];
}
}
@@ -240,7 +258,7 @@ var hljs = new function() {
}
function isIllegal(lexem, mode) {
- return mode.illegalRe && mode.illegalRe.test(lexem);
+ return mode.illegal && mode.illegalRe.test(lexem);
}
function compileTerminators(mode, language) {
@@ -262,69 +280,81 @@ var hljs = new function() {
terminators.push(mode.illegal);
}
- return langRe(language, '(' + terminators.join('|') + ')', true);
+ return terminators.length ? langRe(language, terminators.join('|'), true) : null;
}
function eatModeChunk(value, index) {
var mode = modes[modes.length - 1];
- if (!mode.terminators) {
+ if (mode.terminators === undefined) {
mode.terminators = compileTerminators(mode, language);
}
- mode.terminators.lastIndex = index;
- var match = mode.terminators.exec(value);
- if (match)
- return [value.substr(index, match.index - index), match[0], false];
- else
- return [value.substr(index), '', true];
+ var match;
+ if (mode.terminators) {
+ mode.terminators.lastIndex = index;
+ match = mode.terminators.exec(value);
+ }
+ return match ? [value.substr(index, match.index - index), match[0], false] : [value.substr(index), '', true];
}
function keywordMatch(mode, match) {
- var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]
- for (var className in mode.keywordGroups) {
- if (!mode.keywordGroups.hasOwnProperty(className))
- continue;
- var value = mode.keywordGroups[className].hasOwnProperty(match_str);
- if (value)
- return [className, value];
- }
+ var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];
+ var value = mode.keywords[match_str];
+ if (value && value instanceof Array)
+ return value;
return false;
}
function processKeywords(buffer, mode) {
+ buffer = escape(buffer);
if (!mode.keywords)
- return escape(buffer);
+ return buffer;
var result = '';
var last_index = 0;
mode.lexemsRe.lastIndex = 0;
var match = mode.lexemsRe.exec(buffer);
while (match) {
- result += escape(buffer.substr(last_index, match.index - last_index));
+ result += buffer.substr(last_index, match.index - last_index);
var keyword_match = keywordMatch(mode, match);
if (keyword_match) {
keyword_count += keyword_match[1];
- result += '<span class="'+ keyword_match[0] +'">' + escape(match[0]) + '</span>';
+ result += '<span class="'+ keyword_match[0] +'">' + match[0] + '</span>';
} else {
- result += escape(match[0]);
+ result += match[0];
}
last_index = mode.lexemsRe.lastIndex;
match = mode.lexemsRe.exec(buffer);
}
- result += escape(buffer.substr(last_index, buffer.length - last_index));
- return result;
+ return result + buffer.substr(last_index);
}
- function processBuffer(buffer, mode) {
- if (mode.subLanguage && languages[mode.subLanguage]) {
- var result = highlight(mode.subLanguage, buffer);
+ function processSubLanguage(buffer, mode) {
+ var result;
+ if (mode.subLanguage == '') {
+ result = highlightAuto(buffer);
+ } else {
+ result = highlight(mode.subLanguage, buffer);
+ }
+ // Counting embedded language score towards the host language may be disabled
+ // with zeroing the containing mode relevance. Usecase in point is Markdown that
+ // allows XML everywhere and makes every XML snippet to have a much larger Markdown
+ // score.
+ if (mode.relevance > 0) {
keyword_count += result.keyword_count;
- return result.value;
+ relevance += result.relevance;
+ }
+ return '<span class="' + result.language + '">' + result.value + '</span>';
+ }
+
+ function processBuffer(buffer, mode) {
+ if (mode.subLanguage && languages[mode.subLanguage] || mode.subLanguage == '') {
+ return processSubLanguage(buffer, mode);
} else {
return processKeywords(buffer, mode);
}
}
function startNewMode(mode, lexem) {
- var markup = mode.className?'<span class="' + mode.className + '">':'';
+ var markup = mode.className? '<span class="' + mode.className + '">': '';
if (mode.returnBegin) {
result += markup;
mode.buffer = '';
@@ -388,30 +418,29 @@ var hljs = new function() {
var keyword_count = 0;
var result = '';
try {
- var index = 0;
+ var mode_info, index = 0;
language.defaultMode.buffer = '';
do {
- var mode_info = eatModeChunk(value, index);
+ mode_info = eatModeChunk(value, index);
var return_lexem = processModeInfo(mode_info[0], mode_info[1], mode_info[2]);
index += mode_info[0].length;
if (!return_lexem) {
index += mode_info[1].length;
}
} while (!mode_info[2]);
- if(modes.length > 1)
- throw 'Illegal';
return {
relevance: relevance,
keyword_count: keyword_count,
- value: result
- }
+ value: result,
+ language: language_name
+ };
} catch (e) {
if (e == 'Illegal') {
return {
relevance: 0,
keyword_count: 0,
value: escape(value)
- }
+ };
} else {
throw e;
}
@@ -467,7 +496,7 @@ var hljs = new function() {
if (tabReplace) {
value = value.replace(/^((<[^>]+>|\t)+)/gm, function(match, p1, offset, s) {
return p1.replace(/\t/g, tabReplace);
- })
+ });
}
if (useBR) {
value = value.replace(/\n/g, '<br>');
@@ -482,17 +511,18 @@ var hljs = new function() {
function highlightBlock(block, tabReplace, useBR) {
var text = blockText(block, useBR);
var language = blockLanguage(block);
+ var result, pre;
if (language == 'no-highlight')
return;
if (language) {
- var result = highlight(language, text);
+ result = highlight(language, text);
} else {
- var result = highlightAuto(text);
+ result = highlightAuto(text);
language = result.language;
}
var original = nodeStream(block);
if (original.length) {
- var pre = document.createElement('pre');
+ pre = document.createElement('pre');
pre.innerHTML = result.value;
result.value = mergeStreams(original, nodeStream(pre), text);
}
@@ -502,10 +532,10 @@ var hljs = new function() {
if (!class_name.match('(\\s|^)(language-)?' + language + '(\\s|$)')) {
class_name = class_name ? (class_name + ' ' + language) : language;
}
- if (/MSIE [678]/.test(navigator.userAgent) && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {
+ if (is_old_IE && block.tagName == 'CODE' && block.parentNode.tagName == 'PRE') {
// This is for backwards compatibility only. IE needs this strange
// hack becasue it cannot just cleanly replace <code> block contents.
- var pre = block.parentNode;
+ pre = block.parentNode;
var container = document.createElement('div');
container.innerHTML = '<pre><code>' + result.value + '</code></pre>';
block = container.firstChild.firstChild;
@@ -573,12 +603,13 @@ var hljs = new function() {
this.IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*';
this.UNDERSCORE_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*';
this.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
- this.C_NUMBER_RE = '\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)';
+ this.C_NUMBER_RE = '(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
+ this.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
this.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
// Common modes
this.BACKSLASH_ESCAPE = {
- begin: '\\\\.', relevance: 0
+ begin: '\\\\[\\s\\S]', relevance: 0
};
this.APOS_STRING_MODE = {
className: 'string',
@@ -616,6 +647,11 @@ var hljs = new function() {
begin: this.C_NUMBER_RE,
relevance: 0
};
+ this.BINARY_NUMBER_MODE = {
+ className: 'number',
+ begin: this.BINARY_NUMBER_RE,
+ relevance: 0
+ };
// Utility functions
this.inherit = function(parent, obj) {
View
42 vendor/assets/javascripts/highlight_js/languages/1c.js
@@ -4,10 +4,36 @@ Author: Yuri Ivanov <ivanov@supersoft.ru>
Contributors: Sergey Baranov <segyrn@yandex.ru>
*/
-hljs.LANGUAGES['1c'] = function(){
+hljs.LANGUAGES['1c'] = function(hljs){
var IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
- var OneS_KEYWORDS = {'возврат':1,'дата':1,'для':1,'если':1,'и':1,'или':1,'иначе':1,'иначеесли':1,'исключение':1,'конецесли':1,'конецпопытки':1,'конецпроцедуры':1,'конецфункции':1,'конеццикла':1,'константа':1,'не':1,'перейти':1,'перем':1,'перечисление':1,'по':1,'пока':1,'попытка':1,'прервать':1,'продолжить':1,'процедура':1,'строка':1,'тогда':1,'фс':1,'функция':1,'цикл':1,'число':1,'экспорт':1};
- var OneS_BUILT_IN = {'ansitooem':1,'oemtoansi':1,'ввестивидсубконто':1,'ввестидату':1,'ввестизначение':1,'ввестиперечисление':1,'ввестипериод':1,'ввестиплансчетов':1,'ввестистроку':1,'ввестичисло':1,'вопрос':1,'восстановитьзначение':1,'врег':1,'выбранныйплансчетов':1,'вызватьисключение':1,'датагод':1,'датамесяц':1,'датачисло':1,'добавитьмесяц':1,'завершитьработусистемы':1,'заголовоксистемы':1,'записьжурналарегистрации':1,'запуститьприложение':1,'зафиксироватьтранзакцию':1,'значениевстроку':1,'значениевстрокувнутр':1,'значениевфайл':1,'значениеизстроки':1,'значениеизстрокивнутр':1,'значениеизфайла':1,'имякомпьютера':1,'имяпользователя':1,'каталогвременныхфайлов':1,'каталогиб':1,'каталогпользователя':1,'каталогпрограммы':1,'кодсимв':1,'командасистемы':1,'конгода':1,'конецпериодаби':1,'конецрассчитанногопериодаби':1,'конецстандартногоинтервала':1,'конквартала':1,'конмесяца':1,'коннедели':1,'лев':1,'лог':1,'лог10':1,'макс':1,'максимальноеколичествосубконто':1,'мин':1,'монопольныйрежим':1,'названиеинтерфейса':1,'названиенабораправ':1,'назначитьвид':1,'назначитьсчет':1,'найти':1,'найтипомеченныенаудаление':1,'найтиссылки':1,'началопериодаби':1,'началостандартногоинтервала':1,'начатьтранзакцию':1,'начгода':1,'начквартала':1,'начмесяца':1,'начнедели':1,'номерднягода':1,'номерднянедели':1,'номернеделигода':1,'нрег':1,'обработкаожидания':1,'окр':1,'описаниеошибки':1,'основнойжурналрасчетов':1,'основнойплансчетов':1,'основнойязык':1,'открытьформу':1,'открытьформумодально':1,'отменитьтранзакцию':1,'очиститьокносообщений':1,'периодстр':1,'полноеимяпользователя':1,'получитьвремята':1,'получитьдатута':1,'получитьдокументта':1,'получитьзначенияотбора':1,'получитьпозициюта':1,'получитьпустоезначение':1,'получитьта':1,'прав':1,'праводоступа':1,'предупреждение':1,'префиксавтонумерации':1,'пустаястрока':1,'пустоезначение':1,'рабочаядаттьпустоезначение':1,'получитьта':1,'прав':1,'праводоступа':1,'предупреждение':1,'префиксавтонумерации':1,'пустаястрока':1,'пустоезначение':1,'рабочаядата':1,'разделительстраниц':1,'разделительстрок':1,'разм':1,'разобратьпозициюдокумента':1,'рассчитатьрегистрына':1,'рассчитатьрегистрыпо':1,'сигнал':1,'симв':1,'символтабуляции':1,'создатьобъект':1,'сокрл':1,'сокрлп':1,'сокрп':1,' сообщить':1,'состояние':1,'сохранитьзначение':1,'сред':1,'статусвозврата':1,'стрдлина':1,'стрзаменить':1,'стрколичествострок':1,'стрполучитьстроку':1,' стрчисловхождений':1,'сформироватьпозициюдокумента':1,'счетпокоду':1,'текущаядата':1,'текущеевремя':1,'типзначения':1,'типзначениястр':1,'удалитьобъекты':1,'установитьтана':1,'установитьтапо':1,'фиксшаблон':1,'формат':1,'цел':1,'шаблон':1};
+ var OneS_KEYWORDS = 'возврат дата для если и или иначе иначеесли исключение конецесли ' +
+ 'конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем ' +
+ 'перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл ' +
+ 'число экспорт';
+ var OneS_BUILT_IN = 'ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ' +
+ 'ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос ' +
+ 'восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц ' +
+ 'датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации ' +
+ 'запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр ' +
+ 'значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера ' +
+ 'имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы ' +
+ 'кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби ' +
+ 'конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс ' +
+ 'максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ ' +
+ 'назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби ' +
+ 'началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели ' +
+ 'номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки ' +
+ 'основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально ' +
+ 'отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята ' +
+ 'получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта ' +
+ 'получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации ' +
+ 'пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц ' +
+ 'разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына ' +
+ 'рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп ' +
+ 'сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить ' +
+ 'стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента ' +
+ 'счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты ' +
+ 'установитьтана установитьтапо фиксшаблон формат цел шаблон';
var DQUOTE = {className: 'dquote', begin: '""'};
var STR_START = {
className: 'string',
@@ -25,7 +51,7 @@ hljs.LANGUAGES['1c'] = function(){
case_insensitive: true,
defaultMode: {
lexems: IDENT_RE_RU,
- keywords: {'keyword':OneS_KEYWORDS,'built_in':OneS_BUILT_IN},
+ keywords: {keyword: OneS_KEYWORDS, built_in: OneS_BUILT_IN},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.NUMBER_MODE,
@@ -34,7 +60,7 @@ hljs.LANGUAGES['1c'] = function(){
className: 'function',
begin: '(процедура|функция)', end: '$',
lexems: IDENT_RE_RU,
- keywords: {'процедура': 1, 'экспорт': 1, 'функция': 1},
+ keywords: 'процедура функция',
contains: [
{className: 'title', begin: IDENT_RE_RU},
{
@@ -45,14 +71,14 @@ hljs.LANGUAGES['1c'] = function(){
className: 'params',
begin: '\\(', end: '\\)',
lexems: IDENT_RE_RU,
- keywords: {'знач':1},
+ keywords: 'знач',
contains: [STR_START, STR_CONT]
},
{
className: 'export',
begin: 'экспорт', endsWithParent: true,
lexems: IDENT_RE_RU,
- keywords: {'экспорт': 1},
+ keywords: 'экспорт',
contains: [hljs.C_LINE_COMMENT_MODE]
}
]
@@ -65,4 +91,4 @@ hljs.LANGUAGES['1c'] = function(){
]
}
};
-}();
+}(hljs);
View
85 vendor/assets/javascripts/highlight_js/languages/actionscript.js
@@ -0,0 +1,85 @@
+/*
+Language: ActionScript
+Author: Alexander Myadzel <myadzel@gmail.com>
+*/
+
+hljs.LANGUAGES['actionscript'] = function(hljs) {
+ var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
+ var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
+
+ var AS3_REST_ARG_MODE = {
+ className: 'rest_arg',
+ begin: '[.]{3}', end: IDENT_RE,
+ relevance: 10
+ };
+ var TITLE_MODE = {className: 'title', begin: IDENT_RE};
+
+ return {
+ defaultMode: {
+ keywords: {
+ keyword: 'as break case catch class const continue default delete do dynamic each ' +
+ 'else extends final finally for function get if implements import in include ' +
+ 'instanceof interface internal is namespace native new override package private ' +
+ 'protected public return set static super switch this throw try typeof use var void ' +
+ 'while with',
+ literal: 'true false null undefined'
+ },
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'package',
+ beginWithKeyword: true, end: '{',
+ keywords: 'package',
+ contains: [TITLE_MODE]
+ },
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ keywords: 'class interface',
+ contains: [
+ {
+ beginWithKeyword: true,
+ keywords: 'extends implements'
+ },
+ TITLE_MODE
+ ]
+ },
+ {
+ className: 'preprocessor',
+ beginWithKeyword: true, end: ';',
+ keywords: 'import include'
+ },
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '[{;]',
+ keywords: 'function',
+ illegal: '\\S',
+ contains: [
+ TITLE_MODE,
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ AS3_REST_ARG_MODE
+ ]
+ },
+ {
+ className: 'type',
+ begin: ':',
+ end: IDENT_FUNC_RETURN_TYPE_RE,
+ relevance: 10
+ }
+ ]
+ }
+ ]
+ }
+ }
+}(hljs);
View
505 vendor/assets/javascripts/highlight_js/languages/apache.js
@@ -7,426 +7,113 @@ Version: 1.1
Date: 2008-12-27
*/
-hljs.LANGUAGES.apache = function(){
+hljs.LANGUAGES['apache'] = function(hljs) {
var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
- var CBRACKET = {
- className: 'cbracket',
- begin: '[\\$%]\\{', end: '\\}'
- };
- CBRACKET.contains = [CBRACKET, NUMBER];
return {
case_insensitive: true,
defaultMode: {
keywords: {
- 'keyword': {
- 'acceptfilter': 1,
- 'acceptmutex': 1,
- 'acceptpathinfo': 1,
- 'accessfilename': 1,
- 'action': 1,
- 'addalt': 1,
- 'addaltbyencoding': 1,
- 'addaltbytype': 1,
- 'addcharset': 1,
- 'adddefaultcharset': 1,
- 'adddescription': 1,
- 'addencoding': 1,
- 'addhandler': 1,
- 'addicon': 1,
- 'addiconbyencoding': 1,
- 'addiconbytype': 1,
- 'addinputfilter': 1,
- 'addlanguage': 1,
- 'addmoduleinfo': 1,
- 'addoutputfilter': 1,
- 'addoutputfilterbytype': 1,
- 'addtype': 1,
- 'alias': 1,
- 'aliasmatch': 1,
- 'allow': 1,
- 'allowconnect': 1,
- 'allowencodedslashes': 1,
- 'allowoverride': 1,
- 'anonymous': 1,
- 'anonymous_logemail': 1,
- 'anonymous_mustgiveemail': 1,
- 'anonymous_nouserid': 1,
- 'anonymous_verifyemail': 1,
- 'authbasicauthoritative': 1,
- 'authbasicprovider': 1,
- 'authdbduserpwquery': 1,
- 'authdbduserrealmquery': 1,
- 'authdbmgroupfile': 1,
- 'authdbmtype': 1,
- 'authdbmuserfile': 1,
- 'authdefaultauthoritative': 1,
- 'authdigestalgorithm': 1,
- 'authdigestdomain': 1,
- 'authdigestnccheck': 1,
- 'authdigestnonceformat': 1,
- 'authdigestnoncelifetime': 1,
- 'authdigestprovider': 1,
- 'authdigestqop': 1,
- 'authdigestshmemsize': 1,
- 'authgroupfile': 1,
- 'authldapbinddn': 1,
- 'authldapbindpassword': 1,
- 'authldapcharsetconfig': 1,
- 'authldapcomparednonserver': 1,
- 'authldapdereferencealiases': 1,
- 'authldapgroupattribute': 1,
- 'authldapgroupattributeisdn': 1,
- 'authldapremoteuserattribute': 1,
- 'authldapremoteuserisdn': 1,
- 'authldapurl': 1,
- 'authname': 1,
- 'authnprovideralias': 1,
- 'authtype': 1,
- 'authuserfile': 1,
- 'authzdbmauthoritative': 1,
- 'authzdbmtype': 1,
- 'authzdefaultauthoritative': 1,
- 'authzgroupfileauthoritative': 1,
- 'authzldapauthoritative': 1,
- 'authzownerauthoritative': 1,
- 'authzuserauthoritative': 1,
- 'balancermember': 1,
- 'browsermatch': 1,
- 'browsermatchnocase': 1,
- 'bufferedlogs': 1,
- 'cachedefaultexpire': 1,
- 'cachedirlength': 1,
- 'cachedirlevels': 1,
- 'cachedisable': 1,
- 'cacheenable': 1,
- 'cachefile': 1,
- 'cacheignorecachecontrol': 1,
- 'cacheignoreheaders': 1,
- 'cacheignorenolastmod': 1,
- 'cacheignorequerystring': 1,
- 'cachelastmodifiedfactor': 1,
- 'cachemaxexpire': 1,
- 'cachemaxfilesize': 1,
- 'cacheminfilesize': 1,
- 'cachenegotiateddocs': 1,
- 'cacheroot': 1,
- 'cachestorenostore': 1,
- 'cachestoreprivate': 1,
- 'cgimapextension': 1,
- 'charsetdefault': 1,
- 'charsetoptions': 1,
- 'charsetsourceenc': 1,
- 'checkcaseonly': 1,
- 'checkspelling': 1,
- 'chrootdir': 1,
- 'contentdigest': 1,
- 'cookiedomain': 1,
- 'cookieexpires': 1,
- 'cookielog': 1,
- 'cookiename': 1,
- 'cookiestyle': 1,
- 'cookietracking': 1,
- 'coredumpdirectory': 1,
- 'customlog': 1,
- 'dav': 1,
- 'davdepthinfinity': 1,
- 'davgenericlockdb': 1,
- 'davlockdb': 1,
- 'davmintimeout': 1,
- 'dbdexptime': 1,
- 'dbdkeep': 1,
- 'dbdmax': 1,
- 'dbdmin': 1,
- 'dbdparams': 1,
- 'dbdpersist': 1,
- 'dbdpreparesql': 1,
- 'dbdriver': 1,
- 'defaulticon': 1,
- 'defaultlanguage': 1,
- 'defaulttype': 1,
- 'deflatebuffersize': 1,
- 'deflatecompressionlevel': 1,
- 'deflatefilternote': 1,
- 'deflatememlevel': 1,
- 'deflatewindowsize': 1,
- 'deny': 1,
- 'directoryindex': 1,
- 'directorymatch': 1,
- 'directoryslash': 1,
- 'documentroot': 1,
- 'dumpioinput': 1,
- 'dumpiologlevel': 1,
- 'dumpiooutput': 1,
- 'enableexceptionhook': 1,
- 'enablemmap': 1,
- 'enablesendfile': 1,
- 'errordocument': 1,
- 'errorlog': 1,
- 'example': 1,
- 'expiresactive': 1,
- 'expiresbytype': 1,
- 'expiresdefault': 1,
- 'extendedstatus': 1,
- 'extfilterdefine': 1,
- 'extfilteroptions': 1,
- 'fileetag': 1,
- 'filterchain': 1,
- 'filterdeclare': 1,
- 'filterprotocol': 1,
- 'filterprovider': 1,
- 'filtertrace': 1,
- 'forcelanguagepriority': 1,
- 'forcetype': 1,
- 'forensiclog': 1,
- 'gracefulshutdowntimeout': 1,
- 'group': 1,
- 'header': 1,
- 'headername': 1,
- 'hostnamelookups': 1,
- 'identitycheck': 1,
- 'identitychecktimeout': 1,
- 'imapbase': 1,
- 'imapdefault': 1,
- 'imapmenu': 1,
- 'include': 1,
- 'indexheadinsert': 1,
- 'indexignore': 1,
- 'indexoptions': 1,
- 'indexorderdefault': 1,
- 'indexstylesheet': 1,
- 'isapiappendlogtoerrors': 1,
- 'isapiappendlogtoquery': 1,
- 'isapicachefile': 1,
- 'isapifakeasync': 1,
- 'isapilognotsupported': 1,
- 'isapireadaheadbuffer': 1,
- 'keepalive': 1,
- 'keepalivetimeout': 1,
- 'languagepriority': 1,
- 'ldapcacheentries': 1,
- 'ldapcachettl': 1,
- 'ldapconnectiontimeout': 1,
- 'ldapopcacheentries': 1,
- 'ldapopcachettl': 1,
- 'ldapsharedcachefile': 1,
- 'ldapsharedcachesize': 1,
- 'ldaptrustedclientcert': 1,
- 'ldaptrustedglobalcert': 1,
- 'ldaptrustedmode': 1,
- 'ldapverifyservercert': 1,
- 'limitinternalrecursion': 1,
- 'limitrequestbody': 1,
- 'limitrequestfields': 1,
- 'limitrequestfieldsize': 1,
- 'limitrequestline': 1,
- 'limitxmlrequestbody': 1,
- 'listen': 1,
- 'listenbacklog': 1,
- 'loadfile': 1,
- 'loadmodule': 1,
- 'lockfile': 1,
- 'logformat': 1,
- 'loglevel': 1,
- 'maxclients': 1,
- 'maxkeepaliverequests': 1,
- 'maxmemfree': 1,
- 'maxrequestsperchild': 1,
- 'maxrequestsperthread': 1,
- 'maxspareservers': 1,
- 'maxsparethreads': 1,
- 'maxthreads': 1,
- 'mcachemaxobjectcount': 1,
- 'mcachemaxobjectsize': 1,
- 'mcachemaxstreamingbuffer': 1,
- 'mcacheminobjectsize': 1,
- 'mcacheremovalalgorithm': 1,
- 'mcachesize': 1,
- 'metadir': 1,
- 'metafiles': 1,
- 'metasuffix': 1,
- 'mimemagicfile': 1,
- 'minspareservers': 1,
- 'minsparethreads': 1,
- 'mmapfile': 1,
- 'mod_gzip_on': 1,
- 'mod_gzip_add_header_count': 1,
- 'mod_gzip_keep_workfiles': 1,
- 'mod_gzip_dechunk': 1,
- 'mod_gzip_min_http': 1,
- 'mod_gzip_minimum_file_size': 1,
- 'mod_gzip_maximum_file_size': 1,
- 'mod_gzip_maximum_inmem_size': 1,
- 'mod_gzip_temp_dir': 1,
- 'mod_gzip_item_include': 1,
- 'mod_gzip_item_exclude': 1,
- 'mod_gzip_command_version': 1,
- 'mod_gzip_can_negotiate': 1,
- 'mod_gzip_handle_methods': 1,
- 'mod_gzip_static_suffix': 1,
- 'mod_gzip_send_vary': 1,
- 'mod_gzip_update_static': 1,
- 'modmimeusepathinfo': 1,
- 'multiviewsmatch': 1,
- 'namevirtualhost': 1,
- 'noproxy': 1,
- 'nwssltrustedcerts': 1,
- 'nwsslupgradeable': 1,
- 'options': 1,
- 'order': 1,
- 'passenv': 1,
- 'pidfile': 1,
- 'protocolecho': 1,
- 'proxybadheader': 1,
- 'proxyblock': 1,
- 'proxydomain': 1,
- 'proxyerroroverride': 1,
- 'proxyftpdircharset': 1,
- 'proxyiobuffersize': 1,
- 'proxymaxforwards': 1,
- 'proxypass': 1,
- 'proxypassinterpolateenv': 1,
- 'proxypassmatch': 1,
- 'proxypassreverse': 1,
- 'proxypassreversecookiedomain': 1,
- 'proxypassreversecookiepath': 1,
- 'proxypreservehost': 1,
- 'proxyreceivebuffersize': 1,
- 'proxyremote': 1,
- 'proxyremotematch': 1,
- 'proxyrequests': 1,
- 'proxyset': 1,
- 'proxystatus': 1,
- 'proxytimeout': 1,
- 'proxyvia': 1,
- 'readmename': 1,
- 'receivebuffersize': 1,
- 'redirect': 1,
- 'redirectmatch': 1,
- 'redirectpermanent': 1,
- 'redirecttemp': 1,
- 'removecharset': 1,
- 'removeencoding': 1,
- 'removehandler': 1,
- 'removeinputfilter': 1,
- 'removelanguage': 1,
- 'removeoutputfilter': 1,
- 'removetype': 1,
- 'requestheader': 1,
- 'require': 2,
- 'rewritebase': 1,
- 'rewritecond': 10,
- 'rewriteengine': 1,
- 'rewritelock': 1,
- 'rewritelog': 1,
- 'rewriteloglevel': 1,
- 'rewritemap': 1,
- 'rewriteoptions': 1,
- 'rewriterule': 10,
- 'rlimitcpu': 1,
- 'rlimitmem': 1,
- 'rlimitnproc': 1,
- 'satisfy': 1,
- 'scoreboardfile': 1,
- 'script': 1,
- 'scriptalias': 1,
- 'scriptaliasmatch': 1,
- 'scriptinterpretersource': 1,
- 'scriptlog': 1,
- 'scriptlogbuffer': 1,
- 'scriptloglength': 1,
- 'scriptsock': 1,
- 'securelisten': 1,
- 'seerequesttail': 1,
- 'sendbuffersize': 1,
- 'serveradmin': 1,
- 'serveralias': 1,
- 'serverlimit': 1,
- 'servername': 1,
- 'serverpath': 1,
- 'serverroot': 1,
- 'serversignature': 1,
- 'servertokens': 1,
- 'setenv': 1,
- 'setenvif': 1,
- 'setenvifnocase': 1,
- 'sethandler': 1,
- 'setinputfilter': 1,
- 'setoutputfilter': 1,
- 'ssienableaccess': 1,
- 'ssiendtag': 1,
- 'ssierrormsg': 1,
- 'ssistarttag': 1,
- 'ssitimeformat': 1,
- 'ssiundefinedecho': 1,
- 'sslcacertificatefile': 1,
- 'sslcacertificatepath': 1,
- 'sslcadnrequestfile': 1,
- 'sslcadnrequestpath': 1,
- 'sslcarevocationfile': 1,
- 'sslcarevocationpath': 1,
- 'sslcertificatechainfile': 1,
- 'sslcertificatefile': 1,
- 'sslcertificatekeyfile': 1,
- 'sslciphersuite': 1,
- 'sslcryptodevice': 1,
- 'sslengine': 1,
- 'sslhonorciperorder': 1,
- 'sslmutex': 1,
- 'ssloptions': 1,
- 'sslpassphrasedialog': 1,
- 'sslprotocol': 1,
- 'sslproxycacertificatefile': 1,
- 'sslproxycacertificatepath': 1,
- 'sslproxycarevocationfile': 1,
- 'sslproxycarevocationpath': 1,
- 'sslproxyciphersuite': 1,
- 'sslproxyengine': 1,
- 'sslproxymachinecertificatefile': 1,
- 'sslproxymachinecertificatepath': 1,
- 'sslproxyprotocol': 1,
- 'sslproxyverify': 1,
- 'sslproxyverifydepth': 1,
- 'sslrandomseed': 1,
- 'sslrequire': 1,
- 'sslrequiressl': 1,
- 'sslsessioncache': 1,
- 'sslsessioncachetimeout': 1,
- 'sslusername': 1,
- 'sslverifyclient': 1,
- 'sslverifydepth': 1,
- 'startservers': 1,
- 'startthreads': 1,
- 'substitute': 1,
- 'suexecusergroup': 1,
- 'threadlimit': 1,
- 'threadsperchild': 1,
- 'threadstacksize': 1,
- 'timeout': 1,
- 'traceenable': 1,
- 'transferlog': 1,
- 'typesconfig': 1,
- 'unsetenv': 1,
- 'usecanonicalname': 1,
- 'usecanonicalphysicalport': 1,
- 'user': 1,
- 'userdir': 1,
- 'virtualdocumentroot': 1,
- 'virtualdocumentrootip': 1,
- 'virtualscriptalias': 1,
- 'virtualscriptaliasip': 1,
- 'win32disableacceptex': 1,
- 'xbithack': 1
- },
- 'literal': {'on': 1, 'off': 1}
+ keyword: 'acceptfilter acceptmutex acceptpathinfo accessfilename action addalt ' +
+ 'addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription ' +
+ 'addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter ' +
+ 'addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias ' +
+ 'aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous ' +
+ 'anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail ' +
+ 'authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery ' +
+ 'authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative ' +
+ 'authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat ' +
+ 'authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize ' +
+ 'authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig ' +
+ 'authldapcomparednonserver authldapdereferencealiases authldapgroupattribute ' +
+ 'authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn ' +
+ 'authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative ' +
+ 'authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative ' +
+ 'authzldapauthoritative authzownerauthoritative authzuserauthoritative ' +
+ 'balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire ' +
+ 'cachedirlength cachedirlevels cachedisable cacheenable cachefile ' +
+ 'cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod ' +
+ 'cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize ' +
+ 'cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate ' +
+ 'cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly ' +
+ 'checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog ' +
+ 'cookiename cookiestyle cookietracking coredumpdirectory customlog dav ' +
+ 'davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep ' +
+ 'dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon ' +
+ 'defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel ' +
+ 'deflatefilternote deflatememlevel deflatewindowsize deny directoryindex ' +
+ 'directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput ' +
+ 'enableexceptionhook enablemmap enablesendfile errordocument errorlog example ' +
+ 'expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine ' +
+ 'extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider ' +
+ 'filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout ' +
+ 'group header headername hostnamelookups identitycheck identitychecktimeout ' +
+ 'imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions ' +
+ 'indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery ' +
+ 'isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive ' +
+ 'keepalivetimeout languagepriority ldapcacheentries ldapcachettl ' +
+ 'ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ' +
+ 'ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ' +
+ 'ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields ' +
+ 'limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog ' +
+ 'loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests ' +
+ 'maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads ' +
+ 'maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer ' +
+ 'mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix ' +
+ 'mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on ' +
+ 'mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk ' +
+ 'mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size ' +
+ 'mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include ' +
+ 'mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate ' +
+ 'mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary ' +
+ 'mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy ' +
+ 'nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho ' +
+ 'proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset ' +
+ 'proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv ' +
+ 'proxypassmatch proxypassreverse proxypassreversecookiedomain ' +
+ 'proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote ' +
+ 'proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia ' +
+ 'readmename receivebuffersize redirect redirectmatch redirectpermanent ' +
+ 'redirecttemp removecharset removeencoding removehandler removeinputfilter ' +
+ 'removelanguage removeoutputfilter removetype requestheader require rewritebase ' +
+ 'rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap ' +
+ 'rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile ' +
+ 'script scriptalias scriptaliasmatch scriptinterpretersource scriptlog ' +
+ 'scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail ' +
+ 'sendbuffersize serveradmin serveralias serverlimit servername serverpath ' +
+ 'serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler ' +
+ 'setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ' +
+ 'ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath ' +
+ 'sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath ' +
+ 'sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite ' +
+ 'sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions ' +
+ 'sslpassphrasedialog sslprotocol sslproxycacertificatefile ' +
+ 'sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath ' +
+ 'sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile ' +
+ 'sslproxymachinecertificatepath sslproxyprotocol sslproxyverify ' +
+ 'sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache ' +
+ 'sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers ' +
+ 'startthreads substitute suexecusergroup threadlimit threadsperchild ' +
+ 'threadstacksize timeout traceenable transferlog typesconfig unsetenv ' +
+ 'usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot ' +
+ 'virtualdocumentrootip virtualscriptalias virtualscriptaliasip ' +
+ 'win32disableacceptex xbithack',
+ literal: 'on off'
},
contains: [
hljs.HASH_COMMENT_MODE,
- {className: 'sqbracket', begin: '\\s\\[', end: '\\]$'},
- CBRACKET,
+ {
+ className: 'sqbracket',
+ begin: '\\s\\[', end: '\\]$'
+ },
+ {
+ className: 'cbracket',
+ begin: '[\\$%]\\{', end: '\\}',
+ contains: ['self', NUMBER]
+ },
NUMBER,
{className: 'tag', begin: '</?', end: '>'},
hljs.QUOTE_STRING_MODE
]
}
};
-}();
+}(hljs);
View
119 vendor/assets/javascripts/highlight_js/languages/avrasm.js
@@ -3,73 +3,60 @@ Language: AVR Assembler
Author: Vladimir Ermakov <vooon341@gmail.com>
*/
-hljs.LANGUAGES.avrasm =
-{
- case_insensitive: true,
- defaultMode: {
- keywords: {
- 'keyword': {
+hljs.LANGUAGES['avrasm'] = function(hljs) {
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ keyword:
/* mnemonic */
- 'adc': 1, 'add': 1 , 'adiw': 1 , 'and': 1 , 'andi': 1 , 'asr': 1 , 'bclr': 1 , 'bld': 1 , 'brbc': 1 , 'brbs': 1 , 'brcc': 1 ,
- 'brcs': 1, 'break': 1, 'breq': 1, 'brge': 1, 'brhc': 1, 'brhs': 1, 'brid': 1, 'brie': 1, 'brlo': 1, 'brlt': 1, 'brmi': 1,
- 'brne': 1, 'brpl': 1, 'brsh': 1, 'brtc': 1, 'brts': 1, 'brvc': 1, 'brvs': 1, 'bset': 1, 'bst': 1, 'call': 1, 'cbi': 1,
- 'cbr': 1, 'clc': 1, 'clh': 1, 'cli': 1, 'cln': 1, 'clr': 1, 'cls': 1, 'clt': 1, 'clv': 1, 'clz': 1, 'com': 1, 'cp': 1,
- 'cpc': 1, 'cpi': 1, 'cpse': 1, 'dec': 1, 'eicall': 1, 'eijmp': 1, 'elpm': 1, 'eor': 1, 'fmul': 1, 'fmuls': 1, 'fmulsu': 1,
- 'icall': 1, 'ijmp': 1, 'in': 1, 'inc': 1, 'jmp': 1, 'ld': 1, 'ldd': 1, 'ldi': 1, 'lds': 1, 'lpm': 1, 'lsl': 1, 'lsr': 1,
- 'mov': 1, 'movw': 1, 'mul': 1, 'muls': 1, 'mulsu': 1, 'neg': 1, 'nop': 1, 'or': 1, 'ori': 1, 'out': 1, 'pop': 1, 'push': 1,
- 'rcall': 1, 'ret': 1, 'reti': 1, 'rjmp': 1, 'rol': 1, 'ror': 1, 'sbc': 1, 'sbr': 1, 'sbrc': 1, 'sbrs': 1, 'sec': 1, 'seh': 1,
- 'sbi': 1, 'sbci': 1, 'sbic': 1, 'sbis': 1, 'sbiw': 1, 'sei': 1, 'sen': 1, 'ser': 1, 'ses': 1, 'set': 1, 'sev': 1, 'sez': 1,
- 'sleep': 1, 'spm': 1, 'st': 1, 'std': 1, 'sts': 1, 'sub': 1, 'subi': 1, 'swap': 1, 'tst': 1, 'wdr': 1
- },
- 'built_in': {
+ 'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' +
+ 'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' +
+ 'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' +
+ 'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' +
+ 'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' +
+ 'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' +
+ 'subi swap tst wdr',
+ built_in:
/* general purpose registers */
- 'r0': 1, 'r1': 1, 'r2': 1, 'r3': 1, 'r4': 1, 'r5': 1, 'r6': 1, 'r7': 1, 'r8': 1, 'r9': 1, 'r10': 1, 'r11': 1, 'r12': 1,
- 'r13': 1, 'r14': 1, 'r15': 1, 'r16': 1, 'r17': 1, 'r18': 1, 'r19': 1, 'r20': 1, 'r21': 1, 'r22': 1, 'r23': 1, 'r24': 1,
- 'r25': 1, 'r26': 1, 'r27': 1, 'r28': 1, 'r29': 1, 'r30': 1, 'r31': 1,
- 'x': 1 /* R27:R26 */, 'xh': 1 /* R27 */, 'xl': 1 /* R26 */,
- 'y': 1 /* R29:R28 */, 'yh': 1 /* R29 */, 'yl': 1 /* R28 */,
- 'z': 1 /* R31:R30 */, 'zh': 1 /* R31 */, 'zl': 1 /* R30 */,
+ 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' +
+ 'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' +
/* IO Registers (ATMega128) */
- 'ucsr1c': 1, 'udr1': 1, 'ucsr1a': 1, 'ucsr1b': 1, 'ubrr1l': 1, 'ubrr1h': 1, 'ucsr0c': 1, 'ubrr0h': 1, 'tccr3c': 1,
- 'tccr3a': 1, 'tccr3b': 1, 'tcnt3h': 1, 'tcnt3l': 1, 'ocr3ah': 1, 'ocr3al': 1, 'ocr3bh': 1, 'ocr3bl': 1, 'ocr3ch': 1,
- 'ocr3cl': 1, 'icr3h': 1, 'icr3l': 1, 'etimsk': 1, 'etifr': 1, 'tccr1c': 1, 'ocr1ch': 1, 'ocr1cl': 1, 'twcr': 1,
- 'twdr': 1, 'twar': 1, 'twsr': 1, 'twbr': 1, 'osccal': 1, 'xmcra': 1, 'xmcrb': 1, 'eicra': 1, 'spmcsr': 1, 'spmcr': 1,
- 'portg': 1, 'ddrg': 1, 'ping': 1, 'portf': 1, 'ddrf': 1, 'sreg': 1, 'sph': 1, 'spl': 1, 'xdiv': 1, 'rampz': 1,
- 'eicrb': 1, 'eimsk': 1, 'gimsk': 1, 'gicr': 1, 'eifr': 1, 'gifr': 1, 'timsk': 1, 'tifr': 1, 'mcucr': 1,
- 'mcucsr': 1, 'tccr0': 1, 'tcnt0': 1, 'ocr0': 1, 'assr': 1, 'tccr1a': 1, 'tccr1b': 1, 'tcnt1h': 1, 'tcnt1l': 1,
- 'ocr1ah': 1, 'ocr1al': 1, 'ocr1bh': 1, 'ocr1bl': 1, 'icr1h': 1, 'icr1l': 1, 'tccr2': 1, 'tcnt2': 1, 'ocr2': 1,
- 'ocdr': 1, 'wdtcr': 1, 'sfior': 1, 'eearh': 1, 'eearl': 1, 'eedr': 1, 'eecr': 1, 'porta': 1, 'ddra': 1, 'pina': 1,
- 'portb': 1, 'ddrb': 1, 'pinb': 1, 'portc': 1, 'ddrc': 1, 'pinc': 1, 'portd': 1, 'ddrd': 1, 'pind': 1, 'spdr': 1,
- 'spsr': 1, 'spcr': 1, 'udr0': 1, 'ucsr0a': 1, 'ucsr0b': 1, 'ubrr0l': 1, 'acsr': 1, 'admux': 1, 'adcsr': 1, 'adch': 1,
- 'adcl': 1, 'porte': 1, 'ddre': 1, 'pine': 1, 'pinf': 1
- }
- },
- contains: [
- hljs.C_BLOCK_COMMENT_MODE,
- {className: 'comment', begin: ';', end: '$'},
- hljs.C_NUMBER_MODE,
- /*{ // Hex: 0x00, $00; Oct: 0o00; Bin: 0b00000000; Dec: 0
- // пока что-то не получается :(, буду использовать сишную моду.
- className: 'number',
- begin: '((0[xX]|\$)[A-Fa-f0-9]+|0[oO][0-7]+|0[bB][0-1]+|\\d+)'
- }*/
- hljs.QUOTE_STRING_MODE,
- {
- className: 'string',
- begin: '\'', end: '[^\\\\]\'',
- illegal: '[^\\\\][^\']'
+ 'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' +
+ 'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' +
+ 'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' +
+ 'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' +
+ 'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' +
+ 'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' +
+ 'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' +
+ 'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf'
},
- {className: 'label', begin: '^[A-Za-z0-9_.$]+:'},
- {className: 'preprocessor', begin: '#', end: '$'},
- { // директивы «.include» «.macro» и т.д.
- className: 'preprocessor',
- begin: '\\.[a-zA-Z]+'
- },
- { // подстановка в «.macro»
- className: 'localvars',
- begin: '@[0-9]+'
- }
- ]
- }
-};
-
+ contains: [
+ hljs.C_BLOCK_COMMENT_MODE,
+ {className: 'comment', begin: ';', end: '$'},
+ hljs.C_NUMBER_MODE, // 0x..., decimal, float
+ hljs.BINARY_NUMBER_MODE, // 0b...
+ {
+ className: 'number',
+ begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
+ },
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: '\'', end: '[^\\\\]\'',
+ illegal: '[^\\\\][^\']'
+ },
+ {className: 'label', begin: '^[A-Za-z0-9_.$]+:'},
+ {className: 'preprocessor', begin: '#', end: '$'},
+ { // директивы «.include» «.macro» и т.д.
+ className: 'preprocessor',
+ begin: '\\.[a-zA-Z]+'
+ },
+ { // подстановка в «.macro»
+ className: 'localvars',
+ begin: '@[0-9]+'
+ }
+ ]
+ }
+ };
+}(hljs);
View
79 vendor/assets/javascripts/highlight_js/languages/axapta.js
@@ -3,41 +3,44 @@ Language: Axapta
Author: Dmitri Roudakov <dmitri@roudakov.ru>
*/
-hljs.LANGUAGES.axapta = {
- defaultMode: {
- keywords: {'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1,
- 'reverse':1, 'firstfast':1,'firstonly':1,'forupdate':1,'nofetch':1, 'sum':1, 'avg':1, 'minof':1, 'maxof':1, 'count':1, 'order':1, 'group':1, 'by':1, 'asc':1, 'desc':1, 'index':1, 'hint':1, 'like':1,
- 'dispaly':1, 'edit':1, 'client':1, 'server':1, 'ttsbegin':1, 'ttscommit':1,
- 'str':1, 'real':1, 'date':1, 'container':1, 'anytype':1, 'common':1, 'div':1,'mod':1
- },
- contains: [
- hljs.C_LINE_COMMENT_MODE,
- hljs.C_BLOCK_COMMENT_MODE,
- hljs.APOS_STRING_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.C_NUMBER_MODE,
- {
- className: 'preprocessor',
- begin: '#', end: '$'
- },
- {
- className: 'class',
- begin: '(class |interface )', end: '{',
- illegal: ':',
- keywords: {'class': 1, 'interface': 1},
- contains: [
- {
- className: 'inheritance',
- begin: '(implements|extends)',
- keywords: {'extends': 1, 'implements': 1},
- relevance: 10
- },
- {
- className: 'title',
- begin: hljs.UNDERSCORE_IDENT_RE
- }
- ]
- }
- ]
- }
-};
+hljs.LANGUAGES['axapta'] = function(hljs) {
+ return {
+ defaultMode: {
+ keywords: 'false int abstract private char interface boolean static null if for true ' +
+ 'while long throw finally protected extends final implements return void enum else ' +
+ 'break new catch byte super class case short default double public try this switch ' +
+ 'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' +
+ 'order group by asc desc index hint like dispaly edit client server ttsbegin ' +
+ 'ttscommit str real date container anytype common div mod',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$'
+ },
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ illegal: ':',
+ keywords: 'class interface',
+ contains: [
+ {
+ className: 'inheritance',
+ beginWithKeyword: true,
+ keywords: 'extends implements',
+ relevance: 10
+ },
+ {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ }
+ ]
+ }
+ };
+}(hljs);
View
35 vendor/assets/javascripts/highlight_js/languages/bash.js
@@ -3,30 +3,33 @@ Language: Bash
Author: vah <vahtenberg@gmail.com>
*/
-hljs.LANGUAGES.bash = function(){
- var BASH_LITERAL = {'true' : 1, 'false' : 1};
+hljs.LANGUAGES['bash'] = function(hljs) {
+ var BASH_LITERAL = 'true false';
var VAR1 = {
- className: 'variable',
- begin: '\\$([a-zA-Z0-9_]+)\\b'
+ className: 'variable', begin: '\\$[a-zA-Z0-9_]+\\b'
};
var VAR2 = {
- className: 'variable',
- begin: '\\$\\{(([^}])|(\\\\}))+\\}',
- contains: [hljs.C_NUMBER_MODE]
+ className: 'variable', begin: '\\${([^}]|\\\\})+}'
};
- var STRING = {
+ var QUOTE_STRING = {
className: 'string',
begin: '"', end: '"',
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
relevance: 0
};
+ var APOS_STRING = {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: [{begin: '\'\''}],
+ relevance: 0
+ };
var TEST_CONDITION = {
className: 'test_condition',
begin: '', end: '',
- contains: [STRING, VAR1, VAR2, hljs.C_NUMBER_MODE],
+ contains: [QUOTE_STRING, APOS_STRING, VAR1, VAR2],
keywords: {
- 'literal': BASH_LITERAL
+ literal: BASH_LITERAL
},
relevance: 0
};
@@ -34,8 +37,8 @@ hljs.LANGUAGES.bash = function(){
return {
defaultMode: {
keywords: {
- 'keyword': {'if' : 1, 'then' : 1, 'else' : 1, 'fi' : 1, 'for' : 1, 'break' : 1, 'continue' : 1, 'while' : 1, 'in' : 1, 'do' : 1, 'done' : 1, 'echo' : 1, 'exit' : 1, 'return' : 1, 'set' : 1, 'declare' : 1},
- 'literal': BASH_LITERAL
+ keyword: 'if then else fi for break continue while in do done echo exit return set declare',
+ literal: BASH_LITERAL
},
contains: [
{
@@ -43,14 +46,14 @@ hljs.LANGUAGES.bash = function(){
begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
relevance: 10
},
- hljs.HASH_COMMENT_MODE,
- hljs.C_NUMBER_MODE,
- STRING,
VAR1,
VAR2,
+ hljs.HASH_COMMENT_MODE,
+ QUOTE_STRING,
+ APOS_STRING,
hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
]
}
};
-}();
+}(hljs);
View
105 vendor/assets/javascripts/highlight_js/languages/clojure.js
@@ -0,0 +1,105 @@
+/*
+Language: Clojure
+Description: Clojure syntax (based on lisp.js)
+Author: mfornos
+*/
+
+hljs.LANGUAGES['clojure'] = function(hljs) {
+ var keywords = {
+ built_in:
+ // Clojure keywords
+ 'def cond apply if-not if-let if not not= = &lt; < > &lt;= <= >= == + / * - 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: '\\)',
+ relevance: 0
+ };
+ var BODY = {
+ endsWithParent: true, excludeEnd: 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 {
+ case_insensitive: true,
+ defaultMode: {
+ illegal: '\\S',
+ contains: [
+ COMMENT,
+ LIST
+ ]
+ }
+ }
+}(hljs);
View
50 vendor/assets/javascripts/highlight_js/languages/cmake.js
@@ -5,20 +5,36 @@ Author: Igor Kalnitsky <igor.kalnitsky@gmail.com>
Website: http://kalnitsky.org.ua/
*/
-hljs.LANGUAGES.cmake = {
- case_insensitive: true,
- defaultMode: {
- keywords: {
- 'add_custom_command': 2, 'add_custom_target': 2, 'add_definitions': 2, 'add_dependencies': 2, 'add_executable': 2, 'add_library': 2, 'add_subdirectory': 2, 'add_executable': 2, 'add_library': 2, 'add_subdirectory': 2, 'add_test': 2, 'aux_source_directory': 2, 'break': 1, 'build_command': 2, 'cmake_minimum_required': 3, 'cmake_policy': 3, 'configure_file': 1, 'create_test_sourcelist': 1, 'define_property': 1, 'else': 1, 'elseif': 1, 'enable_language': 2, 'enable_testing': 2, 'endforeach': 1, 'endfunction': 1, 'endif': 1, 'endmacro': 1, 'endwhile': 1, 'execute_process': 2, 'export': 1, 'find_file': 1, 'find_library': 2, 'find_package': 2, 'find_path': 1, 'find_program': 1, 'fltk_wrap_ui': 2, 'foreach': 1, 'function': 1, 'get_cmake_property': 3, 'get_directory_property': 1, 'get_filename_component': 1, 'get_property': 1, 'get_source_file_property': 1, 'get_target_property': 1, 'get_test_property': 1, 'if': 1, 'include': 1, 'include_directories': 2, 'include_external_msproject': 1, 'include_regular_expression': 2, 'install': 1, 'link_directories': 1, 'load_cache': 1, 'load_command': 1, 'macro': 1, 'mark_as_advanced': 1, 'message': 1, 'option': 1, 'output_required_files': 1, 'project': 1, 'qt_wrap_cpp': 2, 'qt_wrap_ui': 2, 'remove_definitions': 2, 'return': 1, 'separate_arguments': 1, 'set': 1, 'set_directory_properties': 1, 'set_property': 1, 'set_source_files_properties': 1, 'set_target_properties': 1, 'set_tests_properties': 1, 'site_name': 1, 'source_group': 1, 'string': 1, 'target_link_libraries': 2, 'try_compile': 2, 'try_run': 2, 'unset': 1, 'variable_watch': 2, 'while': 1, 'build_name': 1, 'exec_program': 1, 'export_library_dependencies': 1, 'install_files': 1, 'install_programs': 1, 'install_targets': 1, 'link_libraries': 1, 'make_directory': 1, 'remove': 1, 'subdir_depends': 1, 'subdirs': 1, 'use_mangled_mesa': 1, 'utility_source': 1, 'variable_requires': 1, 'write_file': 1 },
-
- contains: [
- {
- className: 'envvar',
- begin: '\\${', end: '}'
- },
- hljs.HASH_COMMENT_MODE,
- hljs.QUOTE_STRING_MODE,
- hljs.NUMBER_MODE
- ]
- }
-};
+hljs.LANGUAGES['cmake'] = function(hljs) {
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: 'add_custom_command add_custom_target add_definitions add_dependencies ' +
+ 'add_executable add_library add_subdirectory add_test aux_source_directory ' +
+ 'break build_command cmake_minimum_required cmake_policy configure_file ' +
+ 'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
+ 'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
+ 'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
+ 'get_cmake_property get_directory_property get_filename_component get_property ' +
+ 'get_source_file_property get_target_property get_test_property if include ' +
+ 'include_directories include_external_msproject include_regular_expression install ' +
+ 'link_directories load_cache load_command macro mark_as_advanced message option ' +
+ 'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
+ 'separate_arguments set set_directory_properties set_property ' +
+ 'set_source_files_properties set_target_properties set_tests_properties site_name ' +
+ 'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
+ 'while build_name exec_program export_library_dependencies install_files ' +
+ 'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
+ 'subdirs use_mangled_mesa utility_source variable_requires write_file',
+ contains: [
+ {
+ className: 'envvar',
+ begin: '\\${', end: '}'
+ },
+ hljs.HASH_COMMENT_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.NUMBER_MODE
+ ]
+ }
+ };
+}(hljs);
View
112 vendor/assets/javascripts/highlight_js/languages/coffeescript.js
@@ -0,0 +1,112 @@
+/*
+Language: CoffeeScript
+Author: Dmytrii Nagirniak <dnagir@gmail.com>
+Contributors: Oleg Efimov <efimovov@gmail.com>
+Description: CoffeeScript is a programming language that transcompiles to JavaScript. For info about language see http://coffeescript.org/
+*/
+
+hljs.LANGUAGES['coffeescript'] = function(hljs) {
+ var keywords = {
+ keyword:
+ // JS keywords
+ 'in if for while finally new do return else break catch instanceof throw try this ' +
+ 'switch continue typeof delete debugger class extends super' +
+ // Coffee keywords
+ 'then unless until loop of by when and or is isnt not',
+ literal:
+ // JS literals
+ 'true false null undefined ' +
+ // Coffee literals
+ 'yes no on off ',
+ reserved: 'case default function var void with const let enum export import native ' +
+ '__hasProp __extends __slice __bind __indexOf'
+ };
+
+ var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
+
+ var COFFEE_QUOTE_STRING_SUBST_MODE = {
+ className: 'subst',
+ begin: '#\\{', end: '}',
+ keywords: keywords,
+ contains: [hljs.C_NUMBER_MODE, hljs.BINARY_NUMBER_MODE]
+ };
+
+ var COFFEE_QUOTE_STRING_MODE = {
+ className: 'string',
+ begin: '"', end: '"',
+ relevance: 0,
+ contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
+ };
+
+ var COFFEE_HEREDOC_MODE = {
+ className: 'string',
+ begin: '"""', end: '"""',
+ contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
+ };
+
+ var COFFEE_HERECOMMENT_MODE = {
+ className: 'comment',
+ begin: '###', end: '###'
+ };
+
+ var COFFEE_HEREGEX_MODE = {
+ className: 'regexp',
+ begin: '///', end: '///',
+ contains: [hljs.HASH_COMMENT_MODE]
+ };
+
+ var COFFEE_EMPTY_REGEX_MODE = {
+ className: 'regexp', begin: '//[gim]*'
+ };
+
+ var COFFEE_REGEX_MODE = {
+ className: 'regexp',
+ begin: '/\\S(\\\\.|[^\\n])*/[gim]*' // \S is required to parse x / 2 / 3 as two divisions
+ };
+
+ var COFFEE_FUNCTION_DECLARATION_MODE = {
+ className: 'function',
+ begin: JS_IDENT_RE + '\\s*=\\s*(\\(.+\\))?\\s*[-=]>',
+ returnBegin: true,
+ contains: [
+ {
+ className: 'title',
+ begin: JS_IDENT_RE
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)'
+ }
+ ]
+ };
+
+ var COFFEE_EMBEDDED_JAVASCRIPT = {
+ begin: '`', end: '`'