Skip to content

Commit 37e9470

Browse files
authored
feat: use latest Compile Explorer API and use GCC 15.1 as default (#27)
1 parent cfa269c commit 37e9470

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

web/src/js/ctp.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ function compile (compiler, compiler_flags, code) {
1616
const body = {
1717
source: code,
1818
options: {
19-
userArguments: compiler_flags + ' -fno-diagnostics-color -fsyntax-only',
20-
filters: {
21-
execute: true
22-
}
19+
userArguments: compiler_flags + ' -fno-diagnostics-color -fsyntax-only'
2320
}
2421
};
2522
return fetch(`https://godbolt.org/api/compiler/${compiler}/compile`, {
@@ -31,11 +28,7 @@ function compile (compiler, compiler_flags, code) {
3128
method: 'POST'
3229
})
3330
.then(e => e.json())
34-
.then(e => {
35-
const log = e.execResult.buildResult.stderr.map(x => x.text);
36-
log.pop(); // Remove "Compiler did not produce an executable"
37-
return [e.code === 0, log];
38-
});
31+
.then(e => [e.code === 0, e.stderr.map(x => x.text)]);
3932
}
4033

4134
const CTP_INCLUDE = /#\s*include\s*<ctp\/ctp\.hpp>/;

web/src/js/playground.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const COMPILERS = [
3939
const COMPILER_MESSAGE_RE = /<source>:(\d+):(\d+): ((?:fatal )?error|warning):\s+(.+)/;
4040
const DEFAULT_PLAYGROUND_DATA = {
4141
code: CTP_EXAMPLE,
42-
compiler: 'g122',
42+
compiler: 'g151',
4343
compiler_flags: '-fpermissive -std=c++17',
4444
show_compiler_log: true
4545
};

0 commit comments

Comments
 (0)