diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb2eab9..db3103e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # TBD - TBD - Added a parser for the non-beta version of Aizu Online Judge +- Re-added the regex input option for the Facebook Coding Competitions parser # 2.17.4 - August 2nd, 2020 - Fixed the Codeforces contest parser to work with the m1, m2 and m3 subdomains diff --git a/README.md b/README.md index 1bfc7e0a..e384d290 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ It's not required for a tool to parse all these options, since some of them are - **input**: An object which is used to configure how to receive input. Supported types: - **stdin**: Receive input via stdin. No additional options required. - **file**: Receive input via a file. The file name has to be given via the **fileName** option. + - **regex**: Receive input via a file. The file to use is selected by taking the most recently modified that matches the given regex. The regex pattern to use has to be given via the **pattern** option. - **output**: An object which is used to configure how to send output. Supported types: - **stdout**: Send output to stdout. No additional options required. - **file**: Send output to a file. The file name has to be given via the **fileName** option. diff --git a/src/models/IOConfiguration.ts b/src/models/IOConfiguration.ts index 6f2fbabb..a5d6c8fa 100644 --- a/src/models/IOConfiguration.ts +++ b/src/models/IOConfiguration.ts @@ -1,5 +1,5 @@ export interface InputConfiguration { - type: 'stdin' | 'file'; + type: 'stdin' | 'file' | 'regex'; fileName?: string; pattern?: string; } diff --git a/src/parsers/problem/FacebookCodingCompetitionsProblemParser.ts b/src/parsers/problem/FacebookCodingCompetitionsProblemParser.ts index 07aeca0d..a5bb5a15 100644 --- a/src/parsers/problem/FacebookCodingCompetitionsProblemParser.ts +++ b/src/parsers/problem/FacebookCodingCompetitionsProblemParser.ts @@ -37,7 +37,7 @@ export class FacebookCodingCompetitionsProblemParser extends Parser { task.setInput({ pattern: `${filename}_.*input[.]txt`, - type: 'file', + type: 'regex', }); task.setOutput({ diff --git a/tests/data/facebook-coding-competitions/problem/normal.json b/tests/data/facebook-coding-competitions/problem/normal.json index bad3db28..b195e5e5 100644 --- a/tests/data/facebook-coding-competitions/problem/normal.json +++ b/tests/data/facebook-coding-competitions/problem/normal.json @@ -17,7 +17,7 @@ ], "testType": "multiNumber", "input": { - "type": "file", + "type": "regex", "pattern": "leapfrog_ch__.*input[.]txt" }, "output": {