Source file languages.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
(* Built from:
   https://github.com/highlightjs/highlight.js/blob/5697ae5187746c24732e62cd625f3f83004a44ce/SUPPORTED_LANGUAGES.md
   and the list of files in data/languages/
*)

let map =
  [
    [ "1c" ];
    [ "abnf" ];
    [ "accesslog" ];
    [ "actionscript"; "as" ];
    [ "ada" ];
    [ "angelscript"; "asc" ];
    [ "apache"; "apacheconf" ];
    [ "applescript"; "osascript" ];
    [ "arcade" ];
    [ "arduino"; "ino" ];
    [ "armasm"; "arm" ];
    [ "asciidoc"; "adoc" ];
    [ "aspectj" ];
    [ "autohotkey" ];
    [ "autoit" ];
    [ "avrasm" ];
    [ "awk"; "mawk"; "nawk"; "gawk" ];
    [ "bash"; "sh"; "zsh" ];
    [ "basic" ];
    [ "bnf" ];
    [ "brainfuck"; "bf" ];
    [ "c"; "h" ];
    [ "csharp"; "cs" ];
    [ "cpp"; "hpp"; "cc"; "hh"; "c++"; "h++"; "cxx"; "hxx" ];
    [ "cal" ];
    [ "cos"; "cls" ];
    [ "capnproto"; "capnp" ];
    [ "ceylon" ];
    [ "clojure"; "clj" ];
    [ "cmake"; "cmake.in" ];
    [ "coffeescript"; "coffee"; "cson"; "iced" ];
    [ "coq" ];
    [ "crmsh"; "crm"; "pcmk" ];
    [ "crystal"; "cr" ];
    [ "csp" ];
    [ "css" ];
    [ "d" ];
    [ "dart" ];
    [ "dpr"; "dfm"; "pas"; "pascal" ];
    [ "diff"; "patch" ];
    [ "django"; "jinja" ];
    [ "dns"; "zone"; "bind" ];
    [ "dockerfile"; "docker" ];
    [ "dos"; "bat"; "cmd" ];
    [ "dsconfig" ];
    [ "dts" ];
    [ "dust"; "dst" ];
    [ "ebnf" ];
    [ "elixir" ];
    [ "elm" ];
    [ "erlang"; "erl" ];
    [ "excel"; "xls"; "xlsx" ];
    [ "fsharp"; "fs"; "fsx"; "fsi"; "fsscript" ];
    [ "fix" ];
    [ "fortran"; "f90"; "f95" ];
    [ "gcode"; "nc" ];
    [ "gams"; "gms" ];
    [ "gauss"; "gss" ];
    [ "gherkin" ];
    [ "go"; "golang" ];
    [ "golo"; "gololang" ];
    [ "gradle" ];
    [ "graphql"; "gql" ];
    [ "groovy" ];
    [ "haml" ];
    [ "handlebars"; "hbs"; "html.hbs"; "html.handlebars" ];
    [ "haskell"; "hs" ];
    [ "haxe"; "hx" ];
    [
      "xml"; "html"; "xhtml"; "rss"; "atom"; "xjb"; "xsd"; "xsl"; "plist"; "svg";
    ];
    [ "http"; "https" ];
    [ "hy"; "hylang" ];
    [ "inform7"; "i7" ];
    [ "ini"; "toml" ];
    [ "irpf90" ];
    [ "java"; "jsp" ];
    [ "javascript"; "js"; "jsx" ];
    [ "json"; "jsonc"; "json5" ];
    [ "julia"; "jl" ];
    [ "julia-repl" ];
    [ "kotlin"; "kt" ];
    [ "lasso"; "ls"; "lassoscript" ];
    [ "tex" ];
    [ "ldif" ];
    [ "leaf" ];
    [ "less" ];
    [ "lisp" ];
    [ "livecodeserver" ];
    [ "livescript"; "ls" ];
    [ "lua"; "pluto" ];
    [ "makefile"; "mk"; "mak"; "make" ];
    [ "markdown"; "md"; "mkdown"; "mkd" ];
    [ "mathematica"; "mma"; "wl" ];
    [ "matlab" ];
    [ "maxima" ];
    [ "mel" ];
    [ "mercury" ];
    [ "mips"; "mipsasm" ];
    [ "mizar" ];
    [ "mojolicious" ];
    [ "monkey" ];
    [ "moonscript"; "moon" ];
    [ "n1ql" ];
    [ "nginx"; "nginxconf" ];
    [ "nim"; "nimrod" ];
    [ "nix" ];
    [ "nsis" ];
    [ "objectivec"; "mm"; "objc"; "obj-c"; "obj-c++"; "objective-c" ];
    [ "ocaml"; "ml" ];
    [ "glsl" ];
    [ "openscad"; "scad" ];
    [ "ruleslanguage" ];
    [ "oxygene" ];
    [ "parser3" ];
    [ "perl"; "pl"; "pm" ];
    [ "pf"; "pf.conf" ];
    [ "php" ];
    [ "plaintext"; "txt"; "text" ];
    [ "pony" ];
    [ "pgsql"; "postgres"; "postgresql" ];
    [ "powershell"; "ps"; "ps1" ];
    [ "processing" ];
    [ "prolog" ];
    [ "properties" ];
    [ "proto"; "protobuf" ];
    [ "puppet"; "pp" ];
    [ "python"; "py"; "gyp" ];
    [ "profile" ];
    [ "python-repl"; "pycon" ];
    [ "k"; "kdb" ];
    [ "qml" ];
    [ "r" ];
    [ "reasonml"; "re" ];
    [ "rib" ];
    [ "rsl" ];
    [ "graph"; "instances" ];
    [ "ruby"; "rb"; "gemspec"; "podspec"; "thor"; "irb" ];
    [ "rust"; "rs" ];
    [ "SAS"; "sas" ];
    [ "scala" ];
    [ "scheme" ];
    [ "scilab"; "sci" ];
    [ "scss" ];
    [ "shell"; "console" ];
    [ "smali" ];
    [ "smalltalk"; "st" ];
    [ "sml"; "ml" ];
    [ "sql" ];
    [ "stan"; "stanfuncs" ];
    [ "stata" ];
    [ "p21"; "step"; "stp" ];
    [ "stylus"; "styl" ];
    [ "subunit" ];
    [ "swift" ];
    [ "tcl"; "tk" ];
    [ "tap" ];
    [ "thrift" ];
    [ "tp" ];
    [ "twig"; "craftcms" ];
    [ "typescript"; "ts"; "tsx"; "mts"; "cts" ];
    [ "vala" ];
    [ "vbnet"; "vb" ];
    [ "vbscript"; "vbs" ];
    [ "verilog"; "v" ];
    [ "vhdl" ];
    [ "vim" ];
    [ "axapta"; "x" ];
    [ "x86asm" ];
    [ "xl"; "tao" ];
    [ "xquery"; "xpath"; "xq"; "xqm" ];
    [ "yml"; "yaml" ];
    [ "zephir"; "zep" ];
  ]

let map =
  let h = Hashtbl.create 10 in
  List.iter
    (function
      | main_name :: _ as l ->
          List.iter (fun name -> Hashtbl.add h name main_name) l
      | _ -> assert false)
    map;
  h