bbb7fae1904bf49ebd034022f9f189cb.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
  2. var modes = [];
  3. function getModeForPath(path) {
  4. var mode = modesByName.text;
  5. var fileName = path.split(/[\/\\]/).pop();
  6. for (var i = 0; i < modes.length; i++) {
  7. if (modes[i].supportsFile(fileName)) {
  8. mode = modes[i];
  9. break;
  10. }
  11. }
  12. return mode;
  13. }
  14. var Mode = /** @class */ (function () {
  15. function Mode(name, caption, extensions) {
  16. this.name = name;
  17. this.caption = caption;
  18. this.mode = "ace/mode/" + name;
  19. this.extensions = extensions;
  20. var re;
  21. if (/\^/.test(extensions)) {
  22. re = extensions.replace(/\|(\^)?/g, function (a, b) {
  23. return "$|" + (b ? "^" : "^.*\\.");
  24. }) + "$";
  25. }
  26. else {
  27. re = "\\.(" + extensions + ")$";
  28. }
  29. this.extRe = new RegExp(re, "gi");
  30. }
  31. Mode.prototype.supportsFile = function (filename) {
  32. return filename.match(this.extRe);
  33. };
  34. return Mode;
  35. }());
  36. var supportedModes = {
  37. ABAP: ["abap"],
  38. ABC: ["abc"],
  39. ActionScript: ["as"],
  40. ADA: ["ada|adb"],
  41. Alda: ["alda"],
  42. Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
  43. Apex: ["apex|cls|trigger|tgr"],
  44. AQL: ["aql"],
  45. AsciiDoc: ["asciidoc|adoc"],
  46. ASL: ["dsl|asl|asl.json"],
  47. Assembly_ARM32: ["s"],
  48. Assembly_x86: ["asm|a"],
  49. Astro: ["astro"],
  50. AutoHotKey: ["ahk"],
  51. BatchFile: ["bat|cmd"],
  52. Basic: ["bas|bak"],
  53. BibTeX: ["bib"],
  54. C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
  55. C9Search: ["c9search_results"],
  56. Cirru: ["cirru|cr"],
  57. Clojure: ["clj|cljs"],
  58. Cobol: ["CBL|COB"],
  59. coffee: ["coffee|cf|cson|^Cakefile"],
  60. ColdFusion: ["cfm|cfc"],
  61. Crystal: ["cr"],
  62. CSharp: ["cs"],
  63. Csound_Document: ["csd"],
  64. Csound_Orchestra: ["orc"],
  65. Csound_Score: ["sco"],
  66. CSS: ["css"],
  67. CSV: ["csv"],
  68. Curly: ["curly"],
  69. Cuttlefish: ["conf"],
  70. D: ["d|di"],
  71. Dart: ["dart"],
  72. Diff: ["diff|patch"],
  73. Django: ["djt|html.djt|dj.html|djhtml"],
  74. Dockerfile: ["^Dockerfile"],
  75. Dot: ["dot"],
  76. Drools: ["drl"],
  77. Edifact: ["edi"],
  78. Eiffel: ["e|ge"],
  79. EJS: ["ejs"],
  80. Elixir: ["ex|exs"],
  81. Elm: ["elm"],
  82. Erlang: ["erl|hrl"],
  83. Flix: ["flix"],
  84. Forth: ["frt|fs|ldr|fth|4th"],
  85. Fortran: ["f|f90"],
  86. FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
  87. FSL: ["fsl"],
  88. FTL: ["ftl"],
  89. Gcode: ["gcode"],
  90. Gherkin: ["feature"],
  91. Gitignore: ["^.gitignore"],
  92. Glsl: ["glsl|frag|vert"],
  93. Gobstones: ["gbs"],
  94. golang: ["go"],
  95. GraphQLSchema: ["gql"],
  96. Groovy: ["groovy"],
  97. HAML: ["haml"],
  98. Handlebars: ["hbs|handlebars|tpl|mustache"],
  99. Haskell: ["hs"],
  100. Haskell_Cabal: ["cabal"],
  101. haXe: ["hx"],
  102. Hjson: ["hjson"],
  103. HTML: ["html|htm|xhtml|we|wpy"],
  104. HTML_Elixir: ["eex|html.eex"],
  105. HTML_Ruby: ["erb|rhtml|html.erb"],
  106. INI: ["ini|conf|cfg|prefs"],
  107. Io: ["io"],
  108. Ion: ["ion"],
  109. Jack: ["jack"],
  110. Jade: ["jade|pug"],
  111. Java: ["java"],
  112. JavaScript: ["js|jsm|cjs|mjs"],
  113. JEXL: ["jexl"],
  114. JSON: ["json"],
  115. JSON5: ["json5"],
  116. JSONiq: ["jq"],
  117. JSP: ["jsp"],
  118. JSSM: ["jssm|jssm_state"],
  119. JSX: ["jsx"],
  120. Julia: ["jl"],
  121. Kotlin: ["kt|kts"],
  122. LaTeX: ["tex|latex|ltx|bib"],
  123. Latte: ["latte"],
  124. LESS: ["less"],
  125. Liquid: ["liquid"],
  126. Lisp: ["lisp"],
  127. LiveScript: ["ls"],
  128. Log: ["log"],
  129. LogiQL: ["logic|lql"],
  130. Logtalk: ["lgt"],
  131. LSL: ["lsl"],
  132. Lua: ["lua"],
  133. LuaPage: ["lp"],
  134. Lucene: ["lucene"],
  135. Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
  136. Markdown: ["md|markdown"],
  137. Mask: ["mask"],
  138. MATLAB: ["matlab"],
  139. Maze: ["mz"],
  140. MediaWiki: ["wiki|mediawiki"],
  141. MEL: ["mel"],
  142. MIPS: ["s|asm"],
  143. MIXAL: ["mixal"],
  144. MUSHCode: ["mc|mush"],
  145. MySQL: ["mysql"],
  146. Nasal: ["nas"],
  147. Nginx: ["nginx|conf"],
  148. Nim: ["nim"],
  149. Nix: ["nix"],
  150. NSIS: ["nsi|nsh"],
  151. Nunjucks: ["nunjucks|nunjs|nj|njk"],
  152. ObjectiveC: ["m|mm"],
  153. OCaml: ["ml|mli"],
  154. Odin: ["odin"],
  155. PartiQL: ["partiql|pql"],
  156. Pascal: ["pas|p"],
  157. Perl: ["pl|pm"],
  158. pgSQL: ["pgsql"],
  159. PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
  160. PHP_Laravel_blade: ["blade.php"],
  161. Pig: ["pig"],
  162. PLSQL: ["plsql"],
  163. Powershell: ["ps1"],
  164. Praat: ["praat|praatscript|psc|proc"],
  165. Prisma: ["prisma"],
  166. Prolog: ["plg|prolog"],
  167. Properties: ["properties"],
  168. Protobuf: ["proto"],
  169. PRQL: ["prql"],
  170. Puppet: ["epp|pp"],
  171. Python: ["py"],
  172. QML: ["qml"],
  173. R: ["r"],
  174. Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
  175. Razor: ["cshtml|asp"],
  176. RDoc: ["Rd"],
  177. Red: ["red|reds"],
  178. RHTML: ["Rhtml"],
  179. Robot: ["robot|resource"],
  180. RST: ["rst"],
  181. Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
  182. Rust: ["rs"],
  183. SaC: ["sac"],
  184. SASS: ["sass"],
  185. SCAD: ["scad"],
  186. Scala: ["scala|sbt"],
  187. Scheme: ["scm|sm|rkt|oak|scheme"],
  188. Scrypt: ["scrypt"],
  189. SCSS: ["scss"],
  190. SH: ["sh|bash|^.bashrc"],
  191. SJS: ["sjs"],
  192. Slim: ["slim|skim"],
  193. Smarty: ["smarty|tpl"],
  194. Smithy: ["smithy"],
  195. snippets: ["snippets"],
  196. Soy_Template: ["soy"],
  197. Space: ["space"],
  198. SPARQL: ["rq"],
  199. SQL: ["sql"],
  200. SQLServer: ["sqlserver"],
  201. Stylus: ["styl|stylus"],
  202. SVG: ["svg"],
  203. Swift: ["swift"],
  204. Tcl: ["tcl"],
  205. Terraform: ["tf", "tfvars", "terragrunt"],
  206. Tex: ["tex"],
  207. Text: ["txt"],
  208. Textile: ["textile"],
  209. Toml: ["toml"],
  210. TSV: ["tsv"],
  211. TSX: ["tsx"],
  212. Turtle: ["ttl"],
  213. Twig: ["twig|swig"],
  214. Typescript: ["ts|mts|cts|typescript|str"],
  215. Vala: ["vala"],
  216. VBScript: ["vbs|vb"],
  217. Velocity: ["vm"],
  218. Verilog: ["v|vh|sv|svh"],
  219. VHDL: ["vhd|vhdl"],
  220. Visualforce: ["vfp|component|page"],
  221. Vue: ["vue"],
  222. Wollok: ["wlk|wpgm|wtest"],
  223. XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
  224. XQuery: ["xq"],
  225. YAML: ["yaml|yml"],
  226. Zeek: ["zeek|bro"],
  227. Zig: ["zig"]
  228. };
  229. var nameOverrides = {
  230. ObjectiveC: "Objective-C",
  231. CSharp: "C#",
  232. golang: "Go",
  233. C_Cpp: "C and C++",
  234. Csound_Document: "Csound Document",
  235. Csound_Orchestra: "Csound",
  236. Csound_Score: "Csound Score",
  237. coffee: "CoffeeScript",
  238. HTML_Ruby: "HTML (Ruby)",
  239. HTML_Elixir: "HTML (Elixir)",
  240. FTL: "FreeMarker",
  241. PHP_Laravel_blade: "PHP (Blade Template)",
  242. Perl6: "Perl 6",
  243. AutoHotKey: "AutoHotkey / AutoIt"
  244. };
  245. var modesByName = {};
  246. for (var name in supportedModes) {
  247. var data = supportedModes[name];
  248. var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
  249. var filename = name.toLowerCase();
  250. var mode = new Mode(filename, displayName, data[0]);
  251. modesByName[filename] = mode;
  252. modes.push(mode);
  253. }
  254. module.exports = {
  255. getModeForPath: getModeForPath,
  256. modes: modes,
  257. modesByName: modesByName
  258. };
  259. }); (function() {
  260. ace.require(["ace/ext/modelist"], function(m) {
  261. if (typeof module == "object" && typeof exports == "object" && module) {
  262. module.exports = m;
  263. }
  264. });
  265. })();