aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Rincón Blanco <ruben@rinconblanco.es>2020-08-03 15:41:08 +0200
committerGitHub <noreply@github.com>2020-08-03 15:41:08 +0200
commit6b19e593003a548f2e7e99971520467d6bdc9046 (patch)
tree7a9c693cc4fbd8c9da16f45c49507b1bb3fa948f
parentba6b49b2e9daa47eac49484a9dddbd99f5c93b9a (diff)
downloadcompiler-explorer-6b19e593003a548f2e7e99971520467d6bdc9046.tar.gz
compiler-explorer-6b19e593003a548f2e7e99971520467d6bdc9046.zip
Minor improvement to compilation API docs
Removes the `req.body.compiler` fallback when looking for the compiler - It could never be reached
-rw-r--r--docs/API.md10
-rw-r--r--lib/handlers/compile.js2
-rw-r--r--static/panes/conformance-view.js3
3 files changed, 9 insertions, 6 deletions
diff --git a/docs/API.md b/docs/API.md
index 0cfaee96e..22ead274f 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -51,9 +51,9 @@ To specify a compilation request as a JSON document, post it as the appropriate
type and send an object of the form:
```JSON
{
- "source": "Source to compile",
+ "source": "<Source-to-compile>",
"options": {
- "userArguments": "Compiler flags",
+ "userArguments": "<Compiler-flags>",
"compilerOptions": {
"skipAsm": false,
"executorRequest": false
@@ -76,11 +76,13 @@ To specify a compilation request as a JSON document, post it as the appropriate
{"id": "range-v3", "version": "trunk"},
{"id": "fmt", "version": "400"}
]
- }
+ },
+ "lang": "<lang-id (Optional)>",
+ "allowStoreCodeDebug": true
}
```
-Execution Only request:
+Execution Only request example:
```JSON
{
"source": "int main () { return 1; }",
diff --git a/lib/handlers/compile.js b/lib/handlers/compile.js
index 1ddd1edaf..a4e0d0e03 100644
--- a/lib/handlers/compile.js
+++ b/lib/handlers/compile.js
@@ -184,7 +184,7 @@ class CompileHandler {
compilerFor(req) {
if (req.is('json')) {
- const compiler = this.findCompiler(req.lang || req.body.lang, req.params.compiler || req.body.compiler);
+ const compiler = this.findCompiler(req.lang || req.body.lang, req.params.compiler);
if (!compiler) {
const withoutBody = _.extend({}, req.body, {source: '<removed>'});
logger.warn(`Unable to find compiler with lang ${req.lang} for request`, withoutBody);
diff --git a/static/panes/conformance-view.js b/static/panes/conformance-view.js
index 3777f4058..87a471458 100644
--- a/static/panes/conformance-view.js
+++ b/static/panes/conformance-view.js
@@ -296,7 +296,8 @@ Conformance.prototype.compileChild = function (child) {
compilerOptions: {produceAst: false, produceOptInfo: false},
libraries: [],
skipAsm: true
- }
+ },
+ lang: this.langId
};
_.each(this.libsWidget.getLibsInUse(), function (item) {