mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: bug fix
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "3.4.3",
|
||||
"version": "3.4.4",
|
||||
"main": "./src/index.ts",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface ParsedConfig extends Omit<ProblemConfigFile, 'time' | 'memory'
|
||||
export { JudgeRequest } from '@hydrooj/common';
|
||||
|
||||
export interface Session {
|
||||
getLang: (name: string) => LangConfig;
|
||||
getLang: (name: string, doThrow?: boolean) => LangConfig;
|
||||
getNext: (task: JudgeTask) => NextFunction;
|
||||
getEnd: (task: JudgeTask) => NextFunction;
|
||||
fetchFile: <T extends null | string>(namespace: T, files: Record<string, string>) => Promise<T extends null ? string : null>;
|
||||
|
||||
@@ -210,11 +210,11 @@ export class JudgeTask {
|
||||
const s = file.replace('@', '.').split('.');
|
||||
langId = s.pop();
|
||||
while (s.length) {
|
||||
lang = this.session.getLang(langId);
|
||||
lang = this.session.getLang(langId, false);
|
||||
if (lang) break;
|
||||
langId = `${s.pop()}.${langId}`;
|
||||
}
|
||||
} else lang = this.session.getLang(langId);
|
||||
} else lang = this.session.getLang(langId, false);
|
||||
if (!lang) throw new FormatError(`Unknown ${type} language.`);
|
||||
// TODO cache compiled binary
|
||||
const result = await compile(lang, { src: file }, copyIn);
|
||||
|
||||
Reference in new issue
Block a user