]>
Commit | Line | Data |
---|---|---|
65d5cb3b | 1 | const ext_table = { |
502d9da0 MG |
2 | 'c' : 'C', |
3 | ||
4 | 'cc' : 'CPP', | |
5 | 'cpp' : 'CPP', | |
6 | 'cxx' : 'CPP', | |
7 | 'C' : 'CPP', | |
8 | ||
9 | 'go' : 'GOLANG', | |
10 | ||
11 | 'gs' : 'GOLFSCRIPT', | |
12 | ||
13 | 'hs' : 'HASKELL', | |
14 | 'lhs' : 'HASKELL', | |
15 | ||
16 | 'lisp': 'SBCL', | |
17 | 'lsp' : 'SBCL', | |
18 | 'cl' : 'SBCL', | |
19 | 'l' : 'SBCL', | |
20 | ||
21 | 'java': 'JAVA', | |
22 | ||
23 | 'pas' : 'PASCAL', | |
24 | ||
25 | 'pl' : 'PERL', | |
26 | ||
27 | 'py' : 'PYTHON', | |
28 | ||
29 | 'rb' : 'RUBY' | |
30 | } | |
31 | ||
7093e9ba | 32 | function divine_format() { |
dee46c5b | 33 | const filename = q('#prog').value; |
65d5cb3b | 34 | const ext = /\.([^.]*)$/.exec(filename)[1]; |
502d9da0 MG |
35 | |
36 | if(ext_table[ext]) | |
dee46c5b | 37 | q('#prog_format').value = ext_table[ext]; |
7093e9ba MG |
38 | } |
39 | ||
8345760a | 40 | $(() => $('#prog').on('change', divine_format)); |