Support C language

This commit is contained in:
Konrad Borowski 2019-09-19 12:08:17 +02:00
parent c22c71778d
commit 08b7309472
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,13 @@
DELETE FROM implementation_wrappers WHERE implementation_id IN (
SELECT implementation_id
FROM implementations
JOIN languages USING (language_id)
WHERE languages.identifier = 'c'
);
DELETE FROM implementations WHERE implementation_id IN (
SELECT implementation_id
FROM implementations
JOIN languages USING (language_id)
WHERE languages.identifier = 'c'
);

View File

@ -0,0 +1,21 @@
INSERT INTO implementations (language_id, identifier, label)
SELECT language_id, 'clang', 'Clang'
FROM languages
WHERE identifier = 'c';
INSERT INTO implementations (language_id, identifier, label)
SELECT language_id, 'gcc', 'gcc'
FROM languages
WHERE identifier = 'c';
INSERT INTO implementation_wrappers (implementation_id, identifier, label, code, ordering)
SELECT implementation_id, 'run', 'Run', 'mv code code.c; clang %s code.c && ./a.out', 1
FROM implementations
JOIN languages USING (language_id)
WHERE implementations.identifier = 'clang'
AND languages.identifier = 'c';
INSERT INTO implementation_wrappers (implementation_id, identifier, label, code, ordering)
SELECT implementation_id, 'run', 'Run', 'mv code code.c; gcc %s code.c && ./a.out', 1
FROM implementations
WHERE identifier = 'gcc';