PageRenderTime 28ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/media/editors/codemirror/mode/meta.js

https://gitlab.com/lankerd/paGO---Testing-Site
JavaScript | 202 lines | 193 code | 6 blank | 3 comment | 35 complexity | ee05089cfac1020636192bd55ff7c9c1 MD5 | raw file
  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: http://codemirror.net/LICENSE
  3. (function(mod) {
  4. if (typeof exports == "object" && typeof module == "object") // CommonJS
  5. mod(require("../lib/codemirror"));
  6. else if (typeof define == "function" && define.amd) // AMD
  7. define(["../lib/codemirror"], mod);
  8. else // Plain browser env
  9. mod(CodeMirror);
  10. })(function(CodeMirror) {
  11. "use strict";
  12. CodeMirror.modeInfo = [
  13. {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
  14. {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
  15. {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
  16. {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
  17. {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
  18. {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
  19. {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
  20. {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
  21. {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
  22. {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
  23. {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
  24. {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
  25. {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
  26. {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
  27. {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
  28. {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
  29. {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
  30. {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
  31. {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
  32. {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
  33. {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
  34. {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
  35. {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
  36. {name: "Django", mime: "text/x-django", mode: "django"},
  37. {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
  38. {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
  39. {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
  40. {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
  41. {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
  42. {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
  43. {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
  44. {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
  45. {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
  46. {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
  47. {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
  48. {name: "FCL", mime: "text/x-fcl", mode: "fcl"},
  49. {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
  50. {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
  51. {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
  52. {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
  53. {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
  54. {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
  55. {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
  56. {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]},
  57. {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
  58. {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
  59. {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
  60. {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
  61. {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
  62. {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
  63. {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]},
  64. {name: "HTTP", mime: "message/http", mode: "http"},
  65. {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
  66. {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]},
  67. {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
  68. {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
  69. {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
  70. mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
  71. {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
  72. {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
  73. {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
  74. {name: "Jinja2", mime: "null", mode: "jinja2"},
  75. {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
  76. {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
  77. {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
  78. {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
  79. {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
  80. {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
  81. {name: "mIRC", mime: "text/mirc", mode: "mirc"},
  82. {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
  83. {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
  84. {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
  85. {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"},
  86. {name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
  87. {name: "MySQL", mime: "text/x-mysql", mode: "sql"},
  88. {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
  89. {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
  90. {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
  91. {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
  92. {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
  93. {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
  94. {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
  95. {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
  96. {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
  97. {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
  98. {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]},
  99. {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
  100. {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
  101. {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
  102. {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
  103. {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
  104. {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
  105. {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
  106. {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]},
  107. {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
  108. {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
  109. {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
  110. {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
  111. {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
  112. {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
  113. {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
  114. {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
  115. {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
  116. {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
  117. {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
  118. {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
  119. {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
  120. {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
  121. {name: "Solr", mime: "text/x-solr", mode: "solr"},
  122. {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
  123. {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
  124. {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
  125. {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
  126. {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
  127. {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
  128. {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
  129. {name: "sTeX", mime: "text/x-stex", mode: "stex"},
  130. {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
  131. {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
  132. {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
  133. {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
  134. {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
  135. {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
  136. {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
  137. {name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
  138. {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
  139. {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
  140. {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
  141. {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
  142. {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
  143. {name: "Twig", mime: "text/x-twig", mode: "twig"},
  144. {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
  145. {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
  146. {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
  147. {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
  148. {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
  149. {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
  150. {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
  151. {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
  152. {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
  153. {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
  154. {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
  155. {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
  156. ];
  157. // Ensure all modes have a mime property for backwards compatibility
  158. for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
  159. var info = CodeMirror.modeInfo[i];
  160. if (info.mimes) info.mime = info.mimes[0];
  161. }
  162. CodeMirror.findModeByMIME = function(mime) {
  163. mime = mime.toLowerCase();
  164. for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
  165. var info = CodeMirror.modeInfo[i];
  166. if (info.mime == mime) return info;
  167. if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
  168. if (info.mimes[j] == mime) return info;
  169. }
  170. };
  171. CodeMirror.findModeByExtension = function(ext) {
  172. for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
  173. var info = CodeMirror.modeInfo[i];
  174. if (info.ext) for (var j = 0; j < info.ext.length; j++)
  175. if (info.ext[j] == ext) return info;
  176. }
  177. };
  178. CodeMirror.findModeByFileName = function(filename) {
  179. for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
  180. var info = CodeMirror.modeInfo[i];
  181. if (info.file && info.file.test(filename)) return info;
  182. }
  183. var dot = filename.lastIndexOf(".");
  184. var ext = dot > -1 && filename.substring(dot + 1, filename.length);
  185. if (ext) return CodeMirror.findModeByExtension(ext);
  186. };
  187. CodeMirror.findModeByName = function(name) {
  188. name = name.toLowerCase();
  189. for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
  190. var info = CodeMirror.modeInfo[i];
  191. if (info.name.toLowerCase() == name) return info;
  192. if (info.alias) for (var j = 0; j < info.alias.length; j++)
  193. if (info.alias[j].toLowerCase() == name) return info;
  194. }
  195. };
  196. });