Skip to content

Commit

Permalink
Add support for additional languages.
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanzdosilovic committed May 28, 2020
1 parent fcfb046 commit 68bdb27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,17 @@ <h2>Judge0 IDE</h2>
<option value="53" mode="cpp">C++ (GCC 8.3.0)</option>
<option value="54" mode="cpp">C++ (GCC 9.2.0)</option>
<option value="1003" mode="c">C3 (latest)</option> <!-- Replacement mode. Help needed. -->
<option value="86" mode="clojure">Clojure (1.10.1)</option>
<option value="77" mode="UNKNOWN">COBOL (GnuCOBOL 2.2)</option> <!-- Unknown mode. Help needed. -->
<option value="55" mode="UNKNOWN">Common Lisp (SBCL 2.0.0)</option> <!-- Unknown mode. Help needed. -->
<option value="56" mode="UNKNOWN">D (DMD 2.089.1)</option> <!-- Unknown mode. Help needed. -->
<option value="57" mode="UNKNOWN">Elixir (1.9.4)</option> <!-- Unknown mode. Help needed. -->
<option value="58" mode="UNKNOWN">Erlang (OTP 22.2)</option> <!-- Unknown mode. Help needed. -->
<option value="44" mode="plaintext">Executable</option>
<option value="87" mode="fsharp">F# (.NET Core SDK 3.1.202)</option>
<option value="59" mode="UNKNOWN">Fortran (GFortran 9.2.0)</option> <!-- Unknown mode. Help needed. -->
<option value="60" mode="go">Go (1.13.5)</option>
<option value="88" mode="UNKNOWN">Groovy (3.0.3)</option> <!-- Unknown mode. Help needed. -->
<option value="61" mode="UNKNOWN">Haskell (GHC 8.8.1)</option> <!-- Unknown mode. Help needed. -->
<option value="62" mode="java">Java (OpenJDK 13.0.1)</option>
<option value="1004" mode="java">Java (OpenJDK 14.0.1)</option>
Expand All @@ -124,6 +127,7 @@ <h2>Judge0 IDE</h2>
<option value="65" mode="UNKNOWN">OCaml (4.09.0)</option> <!-- Unknown mode. Help needed. -->
<option value="66" mode="UNKNOWN">Octave (5.1.0)</option> <!-- Unknown mode. Help needed. -->
<option value="67" mode="pascal">Pascal (FPC 3.0.4)</option>
<option value="85" mode="perl">Perl (5.28.1)</option>
<option value="68" mode="php">PHP (7.4.1)</option>
<option value="43" mode="plaintext">Plain Text</option>
<option value="69" mode="UNKNOWN">Prolog (GNU Prolog 1.4.5)</option> <!-- Unknown mode. Help needed. -->
Expand Down
21 changes: 20 additions & 1 deletion js/ide.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function run() {
contentType: "application/json",
data: JSON.stringify(data),
xhrFields: {
withCredentials: parseInt($selectLanguage.val()) >= 1000 ? false : true
withCredentials: apiUrl.indexOf("/secure") != -1 ? true : false
},
success: function (data, textStatus, jqXHR) {
console.log(`Your submission token is: ${data.token}`);
Expand Down Expand Up @@ -828,6 +828,8 @@ int main() {\n\
}\n\
";

var clojureSource = "(println \"hello, world\")\n";

var cobolSource = "\
IDENTIFICATION DIVISION.\n\
PROGRAM-ID. MAIN.\n\
Expand Down Expand Up @@ -866,6 +868,8 @@ Content of compiled binary is Base64 encoded and used as source code.\n\
https://ide.judge0.com/?kS_f\n\
";

var fsharpSource = "printfn \"hello, world\"\n";

var fortranSource = "\
program main\n\
print *, \"hello, world\"\n\
Expand All @@ -882,6 +886,8 @@ func main() {\n\
}\n\
";

var groovySource = "println \"hello, world\"\n";

var haskellSource = "main = putStrLn \"hello, world\"";

var javaSource = "\
Expand Down Expand Up @@ -927,6 +933,11 @@ begin\n\
end.\n\
";

var perlSource = "\
my $name = <STDIN>;\n\
print \"hello, $name\";\n\
";

var phpSource = "\
<?php\n\
print(\"hello, world\\n\");\n\
Expand Down Expand Up @@ -1193,6 +1204,10 @@ var sources = {
82: sqliteSource,
83: swiftSource,
84: vbSource,
85: perlSource,
86: clojureSource,
87: fsharpSource,
88: groovySource,
1001: cSource,
1002: cppSource,
1003: c3Source,
Expand Down Expand Up @@ -1249,6 +1264,10 @@ var fileNames = {
82: "script.sql",
83: "Main.swift",
84: "Main.vb",
85: "script.pl",
86: "main.clj",
87: "script.fsx",
88: "script.groovy",
1001: "main.c",
1002: "main.cpp",
1003: "main.c3",
Expand Down

0 comments on commit 68bdb27

Please sign in to comment.