From eaa38c6ba54c0e4a0a2694bf10a0b582aaa191a0 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 15 Feb 2025 20:40:29 +0800 Subject: [PATCH] judge: bug fix --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/interface.ts | 2 +- packages/hydrojudge/src/task.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 14443b7c1..114442a94 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -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 ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/interface.ts b/packages/hydrojudge/src/interface.ts index 35f7e6d2c..ed4f3eefb 100644 --- a/packages/hydrojudge/src/interface.ts +++ b/packages/hydrojudge/src/interface.ts @@ -23,7 +23,7 @@ export interface ParsedConfig extends Omit LangConfig; + getLang: (name: string, doThrow?: boolean) => LangConfig; getNext: (task: JudgeTask) => NextFunction; getEnd: (task: JudgeTask) => NextFunction; fetchFile: (namespace: T, files: Record) => Promise; diff --git a/packages/hydrojudge/src/task.ts b/packages/hydrojudge/src/task.ts index 29ff618ab..56847f289 100644 --- a/packages/hydrojudge/src/task.ts +++ b/packages/hydrojudge/src/task.ts @@ -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);