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