diff options
author | abhishekkaushik22 <151943362+abhishekkaushik22@users.noreply.github.com> | 2023-11-28 09:47:26 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 22:17:26 -0600 |
commit | 63b3f6bebabe02c3bed2b8d0ff718c1e436d2ee6 (patch) | |
tree | b32ed76047088e64c94f26d7371e4f812d2500b2 /lib/compilers/argument-parsers.ts | |
parent | 47d23cb10f7ac912f82e226dd3024923642da514 (diff) | |
download | compiler-explorer-63b3f6bebabe02c3bed2b8d0ff718c1e436d2ee6.tar.gz compiler-explorer-63b3f6bebabe02c3bed2b8d0ff718c1e436d2ee6.zip |
Fix #5660 (#5794)gh-9716
Closes #5660
Diffstat (limited to 'lib/compilers/argument-parsers.ts')
-rw-r--r-- | lib/compilers/argument-parsers.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/compilers/argument-parsers.ts b/lib/compilers/argument-parsers.ts index 7ce4bef4f..604eb434a 100644 --- a/lib/compilers/argument-parsers.ts +++ b/lib/compilers/argument-parsers.ts @@ -1121,3 +1121,31 @@ export class GolangParser extends GCCParser { return options; } } + +export class GnuCobolParser extends GCCParser { + static override getLanguageSpecificHelpFlags(): string[] { + return ['--help']; + } + + static override async getPossibleStdvers(compiler: any): Promise<CompilerOverrideOptions> { + const possible: CompilerOverrideOptions = []; + const options = await this.getOptionsStrict(compiler, this.getLanguageSpecificHelpFlags()); + for (const opt in options) { + if (opt.startsWith('-std=')) { + const vers = options[opt].description + .split(':')[1] + .split(',') + .map(v => v.trim()); + vers[vers.length - 1] = vers[vers.length - 1].split(';')[0]; + for (const ver of vers) { + possible.push({ + name: ver, + value: ver, + }); + } + break; + } + } + return possible; + } +} |