From 87328aa73cac3cfb103ad2038f2ae13c47cd866d Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jun 2019 14:42:35 +0200 Subject: [PATCH 1/3] select Yul compiler --- src/app/tabs/compileTab/compileTab.js | 6 ++++-- src/app/tabs/compileTab/compilerContainer.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index 0b46cc6f60..bdb13e522b 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -46,14 +46,16 @@ class CompileTab { this.compiler.setEvmVersion(this.evmVersion) } + setLanguage (lang) { + this.compiler.setLanguage(lang) + } + /** * Compile a specific file of the file manager * @param {string} target the path to the file to compile */ compileFile (target) { if (!target) throw new Error('No target provided for compiliation') - if (!/\.sol/.exec(target)) throw new Error(`${target} is not a solidity file. It cannot be compiled with solidity compiler`) - // only compile *.sol file. const provider = this.fileManager.fileProviderOf(target) if (!provider) throw new Error(`cannot compile ${target}. Does not belong to any explorer`) return new Promise((resolve, reject) => { diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index 2ef3b1fdc6..f15c2430bb 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -175,6 +175,17 @@ class CompilerContainer { ${this._view.versionSelector} +
+
+ +
+
+ +
+
@@ -227,6 +238,11 @@ class CompilerContainer { this.compileTabLogic.runCompiler() } + onchangeLanguage (event) { + this.compileTabLogic.setLanguage(event.target.value) + this.compile() + } + onchangeEvmVersion (_) { let s = this._view.evmVersionSelector let v = s.value From c712e019991dc079df5a12df24e4aafc90b04b03 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 19 Jun 2019 09:39:56 +0200 Subject: [PATCH 2/3] Update compileTab.js --- src/app/tabs/compileTab/compileTab.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index bdb13e522b..60b7fcfd4e 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -45,7 +45,11 @@ class CompileTab { this.queryParams.update({ evmVersion: this.evmVersion }) this.compiler.setEvmVersion(this.evmVersion) } - + + /** + * Set the compiler to using Solidity or Yul (default to Solidity) + * @params lang {'Solidity' | 'Yul'} ... + */ setLanguage (lang) { this.compiler.setLanguage(lang) } From c1e3fbf9c411149f538856e9bae5b064f13933e0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 19 Jun 2019 09:46:12 +0200 Subject: [PATCH 3/3] standard --- src/app/tabs/compileTab/compileTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index 60b7fcfd4e..1edbea26f3 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -45,7 +45,7 @@ class CompileTab { this.queryParams.update({ evmVersion: this.evmVersion }) this.compiler.setEvmVersion(this.evmVersion) } - + /** * Set the compiler to using Solidity or Yul (default to Solidity) * @params lang {'Solidity' | 'Yul'} ...