From 3a5e7ed9a60c946f3f807422355b0dae83aadcf2 Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 15 Sep 2015 00:35:22 +0200 Subject: new solc api: * use legacy version matcher * optimise just a boolean flag * skipf for messages in tests --- common/compiler/solidity.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'common/compiler/solidity.go') diff --git a/common/compiler/solidity.go b/common/compiler/solidity.go index 5ded4fc6e..aca3a1fc2 100644 --- a/common/compiler/solidity.go +++ b/common/compiler/solidity.go @@ -35,8 +35,8 @@ import ( ) var ( - versionRegExp = regexp.MustCompile("[0-9]+\\.[0-9]+\\.[0-9]+") - newAPIRegexp = regexp.MustCompile("0\\.1\\.[2-9][0-9]*") + versionRegexp = regexp.MustCompile("[0-9]+\\.[0-9]+\\.[0-9]+") + legacyRegexp = regexp.MustCompile("0\\.(9\\..*|1\\.[01])") paramsLegacy = []string{ "--binary", // Request to output the contract in binary (hexadecimal). "file", // @@ -50,13 +50,13 @@ var ( "1", } paramsNew = []string{ - "--bin", // Request to output the contract in binary (hexadecimal). - "--abi", // Request to output the contract's JSON ABI interface. - "--userdoc", // Request to output the contract's Natspec user documentation. - "--devdoc", // Request to output the contract's Natspec developer documentation. - "--add-std", // include standard lib contracts - "--optimize=1", // code optimizer switched on - "-o", // output directory + "--bin", // Request to output the contract in binary (hexadecimal). + "--abi", // Request to output the contract's JSON ABI interface. + "--userdoc", // Request to output the contract's Natspec user documentation. + "--devdoc", // Request to output the contract's Natspec developer documentation. + "--add-std", // include standard lib contracts + "--optimize", // code optimizer switched on + "-o", // output directory } ) @@ -102,8 +102,8 @@ func New(solcPath string) (sol *Solidity, err error) { } fullVersion := out.String() - version := versionRegExp.FindString(fullVersion) - legacy := !newAPIRegexp.MatchString(version) + version := versionRegexp.FindString(fullVersion) + legacy := legacyRegexp.MatchString(version) sol = &Solidity{ solcPath: solcPath, -- cgit v1.2.3