mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 15:26:33 +00:00
feat(editor-language): update language configurations and types for C and C++
This commit is contained in:
parent
d8fa37dd8a
commit
ec9f3b2475
22
src/config/editor-language.ts
Normal file
22
src/config/editor-language.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { EditorLanguage, EditorLanguageMetadata } from "@/types/editor-language";
|
||||
|
||||
// Define language configurations
|
||||
const EditorLanguageConfig: Record<EditorLanguage, EditorLanguageMetadata> = {
|
||||
[EditorLanguage.C]: {
|
||||
id: EditorLanguage.C,
|
||||
label: "C",
|
||||
fileName: "main",
|
||||
fileExtension: ".c",
|
||||
},
|
||||
[EditorLanguage.CPP]: {
|
||||
id: EditorLanguage.CPP,
|
||||
label: "C++",
|
||||
fileName: "main",
|
||||
fileExtension: ".cpp",
|
||||
},
|
||||
};
|
||||
|
||||
// Default language configuration
|
||||
const DefaultEditorLanguageConfig = EditorLanguageConfig[EditorLanguage.C]; // Default to C language
|
||||
|
||||
export { EditorLanguageConfig, DefaultEditorLanguageConfig };
|
11
src/types/editor-language.ts
Normal file
11
src/types/editor-language.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export enum EditorLanguage {
|
||||
C = "c",
|
||||
CPP = "cpp",
|
||||
}
|
||||
|
||||
export type EditorLanguageMetadata = {
|
||||
id: EditorLanguage;
|
||||
label: string;
|
||||
fileName: string;
|
||||
fileExtension: string;
|
||||
};
|
Loading…
Reference in New Issue
Block a user