mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "3.4.3",
|
"version": "3.4.4",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"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 { JudgeRequest } from '@hydrooj/common';
|
||||||
|
|
||||||
export interface Session {
|
export interface Session {
|
||||||
getLang: (name: string) => LangConfig;
|
getLang: (name: string, doThrow?: boolean) => LangConfig;
|
||||||
getNext: (task: JudgeTask) => NextFunction;
|
getNext: (task: JudgeTask) => NextFunction;
|
||||||
getEnd: (task: JudgeTask) => NextFunction;
|
getEnd: (task: JudgeTask) => NextFunction;
|
||||||
fetchFile: <T extends null | string>(namespace: T, files: Record<string, string>) => Promise<T extends null ? string : null>;
|
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('.');
|
const s = file.replace('@', '.').split('.');
|
||||||
langId = s.pop();
|
langId = s.pop();
|
||||||
while (s.length) {
|
while (s.length) {
|
||||||
lang = this.session.getLang(langId);
|
lang = this.session.getLang(langId, false);
|
||||||
if (lang) break;
|
if (lang) break;
|
||||||
langId = `${s.pop()}.${langId}`;
|
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.`);
|
if (!lang) throw new FormatError(`Unknown ${type} language.`);
|
||||||
// TODO cache compiled binary
|
// TODO cache compiled binary
|
||||||
const result = await compile(lang, { src: file }, copyIn);
|
const result = await compile(lang, { src: file }, copyIn);
|
||||||
|
|||||||
Reference in new issue
Block a user