Skip to content

Commit 109cb89

Browse files
committed
Add OCaml language
Used at SWERC24, and as an example for other contests using it. Based on the file by Gabriel Bathie.
1 parent 7fc873f commit 109cb89

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

sql/files/defaultdata/ocaml/build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
# nothing to compile

sql/files/defaultdata/ocaml/run

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
# OCaml compile wrapper-script for 'compile.sh'.
4+
5+
DEST="$1" ; shift
6+
MEMLIMIT="$1" ; shift
7+
8+
# Compilation needs to store intermediate files, `/tmp` is not writable
9+
export TMPDIR="."
10+
11+
# Enable some libraries;
12+
# unix system calls, regular expressions and string processing & multi arrays
13+
# See: https://v2.ocaml.org/releases/5.1/api/index.html
14+
# Consider also setting for faster executables:
15+
# -match-context-rows 100
16+
# -unsafe
17+
# As example of extra libraries see the config of SWERC24:
18+
#ocamlopt unix.cmxa str.cmxa bigarray.cmxa -o "$DEST" "$@" -ccopt -pipe
19+
ocamlopt -o "$DEST" "$@" -ccopt -pipe
20+
21+
exit $?

webapp/src/DataFixtures/DefaultData/LanguageFixture.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function load(ObjectManager $manager): void
4141
['pl', 'pl', 'Perl', ['pl'], false, 'Main file', false, true, 1, 'pl', '', ''],
4242
['plg', 'prolog', 'Prolog', ['plg'], false, 'Main file', false, true, 1, 'plg', '', ''],
4343
['py3', 'python3', 'Python 3', ['py'], false, 'Main file', true, true, 1, 'py3', 'pypy3 --version', 'pypy3 --version'],
44+
['ocaml', 'ocaml', 'OCaml', ['ml'], false, null , false, true, 1, 'ocaml', 'ocamlopt --version', ''],
4445
['r', 'r', 'R', ['R'], false, 'Main file', false, true, 1, 'r', '', ''],
4546
['rb', 'ruby', 'Ruby', ['rb'], false, 'Main file', false, true, 1, 'rb', '', ''],
4647
['rs', 'rust', 'Rust', ['rs'], false, null, false, true, 1, 'rs', '', ''],

webapp/tests/Unit/Controller/Jury/JuryMiscControllerTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,17 @@ public function provideJuryAjax(): Generator
201201
9 => ['id' => 'js', 'text' => 'JavaScript (js)'],
202202
10 => ['id' => 'kt', 'text' => 'Kotlin (kt)'],
203203
11 => ['id' => 'lua', 'text' => 'Lua (lua)'],
204-
12 => ['id' => 'pas', 'text' => 'Pascal (pas)'],
205-
13 => ['id' => 'pl', 'text' => 'Perl (pl)'],
206-
14 => ['id' => 'sh', 'text' => 'POSIX shell (sh)'],
207-
15 => ['id' => 'plg', 'text' => 'Prolog (plg)'],
208-
16 => ['id' => 'py3', 'text' => 'Python 3 (py3)'],
209-
17 => ['id' => 'r', 'text' => 'R (r)'],
210-
18 => ['id' => 'rb', 'text' => 'Ruby (rb)'],
211-
19 => ['id' => 'rs', 'text' => 'Rust (rs)'],
212-
20 => ['id' => 'scala', 'text' => 'Scala (scala)'],
213-
21 => ['id' => 'swift', 'text' => 'Swift (swift)']]]];
204+
12 => ['id' => 'ocaml', 'text' => 'OCaml (ocaml)'],
205+
13 => ['id' => 'pas', 'text' => 'Pascal (pas)'],
206+
14 => ['id' => 'pl', 'text' => 'Perl (pl)'],
207+
15 => ['id' => 'sh', 'text' => 'POSIX shell (sh)'],
208+
16 => ['id' => 'plg', 'text' => 'Prolog (plg)'],
209+
17 => ['id' => 'py3', 'text' => 'Python 3 (py3)'],
210+
18 => ['id' => 'r', 'text' => 'R (r)'],
211+
19 => ['id' => 'rb', 'text' => 'Ruby (rb)'],
212+
20 => ['id' => 'rs', 'text' => 'Rust (rs)'],
213+
21 => ['id' => 'scala', 'text' => 'Scala (scala)'],
214+
22 => ['id' => 'swift', 'text' => 'Swift (swift)']]]];
214215
yield ['contests', $status, [$role], ['results' => [0 => ['id' => 1, 'text' => 'Demo contest (demo - c1)']
215216
]]];
216217
}

0 commit comments

Comments
 (0)