Skip to content

Commit

Permalink
feat: add more languages, mostly from kattis
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhanming committed Jun 2, 2024
1 parent ee0790d commit fa27537
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
28 changes: 28 additions & 0 deletions prisma/migrations/20240602234833_add_new_languages/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.


ALTER TYPE "language" ADD VALUE 'PANDAS';
ALTER TYPE "language" ADD VALUE 'POSTGRESQL';
ALTER TYPE "language" ADD VALUE 'ADA';
ALTER TYPE "language" ADD VALUE 'ALGOL_68';
ALTER TYPE "language" ADD VALUE 'CRYSTAL';
ALTER TYPE "language" ADD VALUE 'D';
ALTER TYPE "language" ADD VALUE 'LUA';
ALTER TYPE "language" ADD VALUE 'MODULA_2';
ALTER TYPE "language" ADD VALUE 'NIM';
ALTER TYPE "language" ADD VALUE 'OCTAVE';
ALTER TYPE "language" ADD VALUE 'ODIN';
ALTER TYPE "language" ADD VALUE 'PERL';
ALTER TYPE "language" ADD VALUE 'SIMULA_67';
ALTER TYPE "language" ADD VALUE 'SMALLTALK';
ALTER TYPE "language" ADD VALUE 'SNOBOL';
ALTER TYPE "language" ADD VALUE 'VISUAL_BASIC';
ALTER TYPE "language" ADD VALUE 'ZIG';

-- AlterEnum
ALTER TYPE "question_type" ADD VALUE 'PANDAS';
20 changes: 19 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -317,27 +317,44 @@ enum Language {
ELIXIR
DART
// For LeetCode Database questions
// For LeetCode Database + Pandas questions
MY_SQL
MS_SQL_SERVER
ORACLE
PANDAS
POSTGRESQL
// For LeetCode Shell questions
BASH
// For Kattis questions
ADA
ALGOL_68
APL
COBOL
LISP
CRYSTAL
D
F_SHARP
FORTRAN
GERBIL
HASKELL
JULIA
LUA
MODULA_2
NIM
OBJECTIVE_C
OCAML
OCTAVE
ODIN
PASCAL
PERL
PROLOG
SIMULA_67
SMALLTALK
SNOBOL
VISUAL_BASIC
ZIG
@@map("language")
}
Expand All @@ -357,6 +374,7 @@ enum QuestionType {
JAVASCRIPT
SHELL
CONCURRENCY
PANDAS
@@map("question_type")
}
Expand Down
18 changes: 18 additions & 0 deletions src/productinfra/judge0/judge0.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,36 @@ export const PRISMA_LANGUAGE_TO_JUDGE0_NAME_PREFIX = {
// MY_SQL is not supported
// MS_SQL_SERVER is not supported
// ORACLE is not supported
[Language.PANDAS]: 'Python (3', // We'll assume Pandas is just Python 3 for now
// POSTGRESQL is not supported
[Language.BASH]: 'Bash',
// ADA is not supported
// ALGOL_68 is not supported
// APL is not supported
[Language.COBOL]: 'COBOL',
[Language.LISP]: 'Common Lisp',
// CRYSTAL is not supported
[Language.D]: 'D (DMD',
[Language.F_SHARP]: 'F#',
[Language.FORTRAN]: 'Fortran',
// GERBIL is not supported
[Language.HASKELL]: 'Haskell',
// JULIA is not supported
[Language.LUA]: 'Lua',
// MODULA_2 is not supported
// NIM is not supported
[Language.OBJECTIVE_C]: 'Objective-C',
[Language.OCAML]: 'OCaml',
[Language.OCTAVE]: 'Octave',
// ODIN is not supported
[Language.PASCAL]: 'Pascal',
[Language.PERL]: 'Perl',
[Language.PROLOG]: 'Prolog',
// SIMULA_67 is not supported
// SMALLTALK is not supported
// SNOBOL is not supported
[Language.VISUAL_BASIC]: 'Visual Basic.Net',
// ZIG is not supported
};

export const VERSION_NUMBER_REGEX = /\d+(\.\d+)+/;
Expand Down

0 comments on commit fa27537

Please sign in to comment.