Add Rust, Julia, Brainfuck, PHP, OCaml and D
[gruntmaster-page.git] / js / 90-divine-format.js
CommitLineData
65d5cb3b 1const ext_table = {
7baee29b
S
2 'bf' : 'BRAINFUCK',
3
502d9da0
MG
4 'c' : 'C',
5
7baee29b
S
6 'd' : 'D',
7
502d9da0
MG
8 'cc' : 'CPP',
9 'cpp' : 'CPP',
10 'cxx' : 'CPP',
11 'C' : 'CPP',
12
13 'go' : 'GOLANG',
14
15 'gs' : 'GOLFSCRIPT',
16
17 'hs' : 'HASKELL',
18 'lhs' : 'HASKELL',
19
20 'lisp': 'SBCL',
21 'lsp' : 'SBCL',
22 'cl' : 'SBCL',
23 'l' : 'SBCL',
24
25 'java': 'JAVA',
26
7baee29b
S
27 'jl' : 'JULIA',
28
29 'ml' : 'OCAML',
30
502d9da0
MG
31 'pas' : 'PASCAL',
32
33 'pl' : 'PERL',
34
7baee29b
S
35 'php' : 'PHP',
36
502d9da0
MG
37 'py' : 'PYTHON',
38
7baee29b
S
39 'rb' : 'RUBY',
40
41 'rs' : 'RUST'
502d9da0
MG
42}
43
7093e9ba 44function divine_format() {
dee46c5b 45 const filename = q('#prog').value;
65d5cb3b 46 const ext = /\.([^.]*)$/.exec(filename)[1];
502d9da0
MG
47
48 if(ext_table[ext])
dee46c5b 49 q('#prog_format').value = ext_table[ext];
7093e9ba
MG
50}
51
8345760a 52$(() => $('#prog').on('change', divine_format));
This page took 0.014376 seconds and 4 git commands to generate.