aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml51
-rw-r--r--CMakeLists.txt2
-rw-r--r--Changelog.md187
-rw-r--r--README.md2
-rw-r--r--appveyor.yml42
-rw-r--r--docs/control-structures.rst4
-rw-r--r--libdevcore/UTF8.cpp81
-rw-r--r--libdevcore/UTF8.h35
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp2
-rw-r--r--libsolidity/ast/ASTJsonConverter.h4
-rw-r--r--libsolidity/ast/Types.cpp11
-rw-r--r--libsolidity/ast/Types.h2
-rw-r--r--libsolidity/codegen/LValue.cpp2
-rw-r--r--libsolidity/codegen/LValue.h2
-rw-r--r--libsolidity/grammar.txt108
-rwxr-xr-xscripts/install_deps.sh14
-rw-r--r--scripts/release.bat5
-rwxr-xr-xscripts/release.sh2
-rwxr-xr-xscripts/release_ppa.sh241
-rwxr-xr-xscripts/travis-emscripten/publish_binary.sh33
20 files changed, 721 insertions, 109 deletions
diff --git a/.travis.yml b/.travis.yml
index c476c154..c116f1b2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -120,33 +120,28 @@ env:
- ENCRYPTION_LABEL="6d4541b72666"
- JOB=default
-# This is the deploy target for the Emscripten build.
-# It publishes the JS file which was compiled as part of the earlier 'build_emscripten.sh'
-# step to https://github.com/ethereum/solc-bin/tree/gh-pages/bin.
-# Both the build and deploy steps for Emscripten are only run within the Ubuntu
-# configurations (not for macOS). That is controlled by conditionals within the bash
-# scripts because TravisCI doesn't provide much in the way of conditional logic.
-
deploy:
- provider: script
- script: test $JOB != emscripten || scripts/release_emscripten.sh
- skip_cleanup: true
- on:
- branch: develop
-
-# This is the deploy target for the native build (Linux and macOS)
-# which generates development ZIPs per commit. We are in agreement
-# that this is probably noisy overkill, so will want to renable this
-# functionality wrapped in some conditionals so that it only runs
-# when building the 'release' branch.
-#
-#deploy:
-# provider: releases
-# api_key:
-# secure: mGeDrlCbhPNQVqrk5wSqFZe/7C5HUIBWcZECJcFrEldN6ELj3a8mhDX9EWebidyFmZsf3ipKVMycJtXZHlH2kVZ0nZdRulq4bYhLiUFRaFQCHMW35dml5mxO/FPp+jhhZaylDUx+cI6AULbj8DvNFqSCfjx8qimRhJjRY4JHeG71N6g5+LU2/dA01D4Y97BUbQ5dYcmEyuEsriSpXOElIQIIv3+Q6MJNnLzxUA6EXsp4Qt3Qf3R1+EkI/RWOPbQsddpFNJBcBNOscCUFSZV3+ZK9E2RyHbPaL+Da4aJKVpgD7X1TFudq4PClMUTkg8CuJh/kvy9wkpaWyYHbLGQqu1vQ+NQ+vlTAKf8U+1xhC1IkX6nA+g4TlRksZRltRhpkBPnFoaQQGjD9eYyT1V/Htrn8Y/VGbYPBVa0GcEYXG5pDCBPz91RBpYwDcyUg9DEPNI6zYfQY8jA8xqtFwPX79Y22MDXIKhBskK00geuzh7Npy5Rnh4fLqVKMlffvYx3kwp444EFWtQ5jxbRCym2Th6EldkOM8Kble1JvixQtVb4s+DpTuwHCTrXZhwMuJpmwgRx52zyIsGrBPF3MOmdlwl+l0TD8UEJXt0JM1XSF1AROyYwXKDZQ9Qt4sd9ZKSWWaLJMEJf4kkZWYgTEI/FhOWlfshQCt8Z9S9r4fq2ywoo=
-# file: $TRAVIS_BUILD_DIR/solidity-develop-$ZIP_SUFFIX.zip
-# skip_cleanup: true
-# on:
-# repo: ethereum/solidity
-# branch: develop
+ # This is the deploy target for the Emscripten build.
+ # It publishes the JS file which was compiled as part of the earlier 'build_emscripten.sh'
+ # step to https://github.com/ethereum/solc-bin/tree/gh-pages/bin.
+ # Both the build and deploy steps for Emscripten are only run within the Ubuntu
+ # configurations (not for macOS). That is controlled by conditionals within the bash
+ # scripts because TravisCI doesn't provide much in the way of conditional logic.
+ - provider: script
+ script: test $JOB != emscripten || scripts/release_emscripten.sh
+ skip_cleanup: true
+ on:
+ branch: develop
+ # This is the deploy target for the native build (Linux and macOS)
+ # which generates ZIPs per commit. We are in agreement that
+ # generating ZIPs per commit for the develop branch is probably
+ # just noise, so we only run this deployment target on 'release'.
+ - provider: releases
+ api_key:
+ secure: mGeDrlCbhPNQVqrk5wSqFZe/7C5HUIBWcZECJcFrEldN6ELj3a8mhDX9EWebidyFmZsf3ipKVMycJtXZHlH2kVZ0nZdRulq4bYhLiUFRaFQCHMW35dml5mxO/FPp+jhhZaylDUx+cI6AULbj8DvNFqSCfjx8qimRhJjRY4JHeG71N6g5+LU2/dA01D4Y97BUbQ5dYcmEyuEsriSpXOElIQIIv3+Q6MJNnLzxUA6EXsp4Qt3Qf3R1+EkI/RWOPbQsddpFNJBcBNOscCUFSZV3+ZK9E2RyHbPaL+Da4aJKVpgD7X1TFudq4PClMUTkg8CuJh/kvy9wkpaWyYHbLGQqu1vQ+NQ+vlTAKf8U+1xhC1IkX6nA+g4TlRksZRltRhpkBPnFoaQQGjD9eYyT1V/Htrn8Y/VGbYPBVa0GcEYXG5pDCBPz91RBpYwDcyUg9DEPNI6zYfQY8jA8xqtFwPX79Y22MDXIKhBskK00geuzh7Npy5Rnh4fLqVKMlffvYx3kwp444EFWtQ5jxbRCym2Th6EldkOM8Kble1JvixQtVb4s+DpTuwHCTrXZhwMuJpmwgRx52zyIsGrBPF3MOmdlwl+l0TD8UEJXt0JM1XSF1AROyYwXKDZQ9Qt4sd9ZKSWWaLJMEJf4kkZWYgTEI/FhOWlfshQCt8Z9S9r4fq2ywoo=
+ file: $TRAVIS_BUILD_DIR/solidity-$ZIP_SUFFIX.zip
+ skip_cleanup: true
+ on:
+ repo: ethereum/solidity
+ branch: release
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48447a49..46e09926 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ include(EthPolicy)
eth_policy()
# project name and version should be set after cmake_policy CMP0048
-set(PROJECT_VERSION "0.3.5")
+set(PROJECT_VERSION "0.3.6")
project(solidity VERSION ${PROJECT_VERSION})
# Let's find our dependencies
diff --git a/Changelog.md b/Changelog.md
new file mode 100644
index 00000000..8805498e
--- /dev/null
+++ b/Changelog.md
@@ -0,0 +1,187 @@
+Features:
+
+ * Fixed point types (in progress)
+
+Bugfixes:
+
+### 0.3.6 (2016-08-10)
+
+Features:
+
+ * Formal verification: Take external effects on a contract into account.
+ * Type Checker: Warning about unused return value of low-level calls and send.
+ * Output: Source location and node id as part of AST output
+ * Output: Source location mappings for bytecode
+ * Output: Formal verification as part of json compiler output.
+
+Bugfixes:
+
+ * Commandline Interface: Do not crash if input is taken from stdin.
+ * Scanner: Correctly support unicode escape codes in strings.
+ * JSON output: Fix error about relative / absolute source file names.
+ * JSON output: Fix error about invalid utf8 strings.
+ * Code Generator: Dynamic allocation of empty array caused infinite loop.
+ * Code Generator: Correctly calculate gas requirements for memcpy precompile.
+ * Optimizer: Clear known state if two code paths are joined.
+
+### 0.3.5 (2016-06-10)
+
+Features:
+
+ * Context-dependent path remappings (different modules can use the same library in different versions)
+
+Bugfixes:
+
+ * Type Checking: Dynamic return types were removed when fetching data from external calls, now they are replaced by an "unusable" type.
+ * Type Checking: Overrides by constructors were considered making a function non-abstract.
+
+### 0.3.4 (2016-05-31)
+
+No change outside documentation.
+
+### 0.3.3 (2016-05-27)
+
+ * Allow internal library functions to be called (by "inlining")
+ * Fractional/rational constants (only usable with fixed point types, which are still in progress)
+ * Inline assembly has access to internal functions (as jump labels)
+ * Running `solc` without arguments on a terminal will print help.
+ * Bugfix: Remove some non-determinism in code generation.
+ * Bugfix: Corrected usage of not / bnot / iszero in inline assembly
+ * Bugfix: Correctly clean bytesNN types before comparison
+
+### 0.3.2 (2016-04-18)
+
+ * Bugfix: Inline assembly parser: `byte` opcode was unusable
+ * Bugfix: Error reporting: tokens for variably-sized types were not converted to string properly
+ * Bugfix: Dynamic arrays of structs were not deleted correctly.
+ * Bugfix: Static arrays in constructor parameter list were not decoded correctly.
+
+### 0.3.1 (2016-03-31)
+
+ * Inline assembly
+ * Bugfix: Code generation: array access with narrow types did not clean higher order bits
+ * Bugfix: Error reporting: error reporting with unknown source location caused a crash
+
+### 0.3.0 (2016-03-11)
+
+BREAKING CHANGES:
+
+ * Added new keywords `assembly`, `foreign`, `fixed`, `ufixed`, `fixedNxM`, `ufixedNxM` (for various values of M and N), `timestamp`
+ * Number constant division does not round to integer, but to a fixed point type (e.g. `1 / 2 != 1`, but `1 / 2 == 0.5`).
+ * Library calls now default to use DELEGATECALL (e.g. called library functions see the same value as the calling function for `msg.value` and `msg.sender`).
+ * `<address>.delegatecall` as a low-level calling interface
+
+Bugfixes:
+ * Fixed a bug in the optimizer that resulted in comparisons being wrong.
+
+
+### 0.2.2 (2016-02-17)
+
+ * Index access for types `bytes1`, ..., `bytes32` (only read access for now).
+ * Bugfix: Type checker crash for wrong number of base constructor parameters.
+
+### 0.2.1 (2016-01-30)
+
+ * Inline arrays, i.e. `var y = [1,x,f()];` if there is a common type for `1`, `x` and `f()`. Note that the result is always a fixed-length memory array and conversion to dynamic-length memory arrays is not yet possible.
+ * Import similar to ECMAScript6 import (`import "abc.sol" as d` and `import {x, y} from "abc.sol"`).
+ * Commandline compiler solc automatically resolves missing imports and allows for "include directories".
+ * Conditional: `x ? y : z`
+ * Bugfix: Fixed several bugs where the optimizer generated invalid code.
+ * Bugfix: Enums and structs were not accessible to other contracts.
+ * Bugfix: Fixed segfault connected to function paramater types, appeared during gas estimation.
+ * Bugfix: Type checker crash for wrong number of base constructor parameters.
+ * Bugfix: Allow function overloads with different array types.
+ * Bugfix: Allow assignments of type `(x) = 7`.
+ * Bugfix: Type `uint176` was not available.
+ * Bugfix: Fixed crash during type checking concerning constructor calls.
+ * Bugfix: Fixed crash during code generation concerning invalid accessors for struct types.
+ * Bugfix: Fixed crash during code generating concerning computing a hash of a struct type.
+
+### 0.2.0 (2015-12-02)
+
+ * **Breaking Change**: `new ContractName.value(10)()` has to be written as `(new ContractName).value(10)()`
+ * Added `selfdestruct` as an alias for `suicide`.
+ * Allocation of memory arrays using `new`.
+ * Binding library functions to types via `using x for y`
+ * `addmod` and `mulmod` (modular addition and modular multiplication with arbitrary intermediate precision)
+ * Bugfix: Constructor arguments of fixed array type were not read correctly.
+ * Bugfix: Memory allocation of structs containing arrays or strings.
+ * Bugfix: Data location for explicit memory parameters in libraries was set to storage.
+
+### 0.1.7 (2015-11-17)
+
+ * Improved error messages for unexpected tokens.
+ * Proof-of-concept transcompilation to why3 for formal verification of contracts.
+ * Bugfix: Arrays (also strings) as indexed parameters of events.
+ * Bugfix: Writing to elements of `bytes` or `string` overwrite others.
+ * Bugfix: "Successor block not found" on Windows.
+ * Bugfix: Using string literals in tuples.
+ * Bugfix: Cope with invalid commit hash in version for libraries.
+ * Bugfix: Some test framework fixes on windows.
+
+### 0.1.6 (2015-10-16)
+
+ * `.push()` for dynamic storage arrays.
+ * Tuple expressions (`(1,2,3)` or `return (1,2,3);`)
+ * Declaration and assignment of multiple variables (`var (x,y,) = (1,2,3,4,5);` or `var (x,y) = f();`)
+ * Destructuring assignment (`(x,y,) = (1,2,3)`)
+ * Bugfix: Internal error about usage of library function with invalid types.
+ * Bugfix: Correctly parse `Library.structType a` at statement level.
+ * Bugfix: Correctly report source locations of parenthesized expressions (as part of "tuple" story).
+
+### 0.1.5 (2015-10-07)
+
+ * Breaking change in storage encoding: Encode short byte arrays and strings together with their length in storage.
+ * Report warnings
+ * Allow storage reference types for public library functions.
+ * Access to types declared in other contracts and libraries via `.`.
+ * Version stamp at beginning of runtime bytecode of libraries.
+ * Bugfix: Problem with initialized string state variables and dynamic data in constructor.
+ * Bugfix: Resolve dependencies concerning `new` automatically.
+ * Bugfix: Allow four indexed arguments for anonymous events.
+ * Bugfix: Detect too large integer constants in functions that accept arbitrary parameters.
+
+### 0.1.4 (2015-09-30)
+
+ * Bugfix: Returning fixed-size arrays.
+ * Bugfix: combined-json output of solc.
+ * Bugfix: Accessing fixed-size array return values.
+ * Bugfix: Disallow assignment from literal strings to storage pointers.
+ * Refactoring: Move type checking into its own module.
+
+### 0.1.3 (2015-09-25)
+
+ * `throw` statement.
+ * Libraries that contain functions which are called via CALLCODE.
+ * Linker stage for compiler to insert other contract's addresses (used for libraries).
+ * Compiler option to output runtime part of contracts.
+ * Compile-time out of bounds check for access to fixed-size arrays by integer constants.
+ * Version string includes libevmasm/libethereum's version (contains the optimizer).
+ * Bugfix: Accessors for constant public state variables.
+ * Bugfix: Propagate exceptions in clone contracts.
+ * Bugfix: Empty single-line comments are now treated properly.
+ * Bugfix: Properly check the number of indexed arguments for events.
+ * Bugfix: Strings in struct constructors.
+
+### 0.1.2 (2015-08-20)
+
+ * Improved commandline interface.
+ * Explicit conversion between `bytes` and `string`.
+ * Bugfix: Value transfer used in clone contracts.
+ * Bugfix: Problem with strings as mapping keys.
+ * Bugfix: Prevent usage of some operators.
+
+### 0.1.1 (2015-08-04)
+
+ * Strings can be used as mapping keys.
+ * Clone contracts.
+ * Mapping members are skipped for structs in memory.
+ * Use only a single stack slot for storage references.
+ * Improved error message for wrong argument count. (#2456)
+ * Bugfix: Fix comparison between `bytesXX` types. (#2087)
+ * Bugfix: Do not allow floats for integer literals. (#2078)
+ * Bugfix: Some problem with many local variables. (#2478)
+ * Bugfix: Correctly initialise `string` and `bytes` state variables.
+ * Bugfix: Correctly compute gas requirements for callcode.
+
+### 0.1.0 (2015-07-10)
diff --git a/README.md b/README.md
index 8a0165b8..9eaae4dd 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ To get started you can find a basic introduction to the language in the [Solidit
You can start using [Solidity in your browser](https://ethereum.github.io/browser-solidity/) with no need to download or compile anything.
-[Changelog](https://github.com/ethereum/wiki/wiki/Solidity-Changelog)
+[Changelog](https://github.com/ethereum/solidity/blob/develop/Changelog.md)
The [Solidity Features](https://github.com/ethereum/wiki/wiki/Solidity-Features) page contains a list of already completed Solidity feature stories with explanations and demonstrations, it is being updated continuously. More technical information you can find in the [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1189488).
diff --git a/appveyor.yml b/appveyor.yml
index 97f931e3..6f1836bb 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -32,7 +32,10 @@ skip_tags: true
os: Visual Studio 2015
configuration:
- RelWithDebInfo
-cache: build
+# NB: Appveyor cache is disabled, because it is proving very unreliable.
+# We can re-enable it when we find a way to mitigate the unreliability
+# issues. Have automated builds be reliable is the more important thing.
+#cache: build
install:
- git submodule update --init --recursive
- scripts/install_deps.bat
@@ -54,23 +57,22 @@ build_script:
# - pkill eth
artifacts:
- - path: solidity-develop-windows.zip
- name: solidity-develop-windows-zip
+ - path: solidity-windows.zip
+ name: solidity-windows-zip
-# This is the deploy target for Windows
-# which generates development ZIPs per commit. We are in agreement
-# that this is probably noisy overkill, so will want to renable this
-# functionality wrapped in some conditionals so that it only runs
-# when building the 'release' branch.
-#
-#deploy:
-# release: solidity-develop-v$(APPVEYOR_BUILD_VERSION)
-# tag: develop-v$(APPVEYOR_BUILD_VERSION)
-# description: 'Development build of solidity at commit $(APPVEYOR_REPO_COMMIT).\n\n$(APPVEYOR_REPO_COMMIT_MESSAGE)\n\nCommitted by $(APPVEYOR_REPO_COMMIT_AUTHOR), $(APPVEYOR_REPO_COMMIT_TIMESTAMP).'
-# prerelease: true
-# provider: GitHub
-# auth_token:
-# secure: yukM9mHUbzuZSS5WSBLKSW0yGJerJEqAXkFhDhSHBBcKJE7GAryjQsdO9Kxh3yRv
-# artifact: solidity-develop-windows-zip
-# on:
-# branch: standalone_changes
+# This is the deploy target for Windows which generates ZIPs per commit.
+# We are in agreement that generating ZIPs per commit for the develop
+# branch is probably just noise, so we only run this deployment target
+# on 'release'.
+
+deploy:
+ release: solidity-develop-v$(APPVEYOR_BUILD_VERSION)
+ tag: develop-v$(APPVEYOR_BUILD_VERSION)
+ description: 'Development build of solidity at commit $(APPVEYOR_REPO_COMMIT).\n\n$(APPVEYOR_REPO_COMMIT_MESSAGE)\n\nCommitted by $(APPVEYOR_REPO_COMMIT_AUTHOR), $(APPVEYOR_REPO_COMMIT_TIMESTAMP).'
+ prerelease: true
+ provider: GitHub
+ auth_token:
+ secure: yukM9mHUbzuZSS5WSBLKSW0yGJerJEqAXkFhDhSHBBcKJE7GAryjQsdO9Kxh3yRv
+ artifact: solidity-windows-zip
+ on:
+ branch: release
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 9d7ebeac..2f131c55 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -339,7 +339,7 @@ these curly braces, the following can be used (see the later sections for more d
- literals, i.e. ``0x123``, ``42`` or ``"abc"`` (strings up to 32 characters)
- opcodes (in "instruction style"), e.g. ``mload sload dup1 sstore``, for a list see below
- - opcode in functional style, e.g. ``add(1, mlod(0))``
+ - opcodes in functional style, e.g. ``add(1, mlod(0))``
- labels, e.g. ``name:``
- variable declarations, e.g. ``let x := 7`` or ``let x := add(y, 3)``
- identifiers (externals, labels or assembly-local variables), e.g. ``jump(name)``, ``3 x add``
@@ -354,7 +354,7 @@ This document does not want to be a full description of the Ethereum virtual mac
following list can be used as a reference of its opcodes.
If an opcode takes arguments (always from the top of the stack), they are given in parentheses.
-Note that the order of arguments can be seed to be reversed in non-functional style (explained below).
+Note that the order of arguments can be seen as being reversed compared to the instructional style (explained below).
Opcodes marked with ``-`` do not push an item onto the stack, those marked with ``*`` are
special and all others push exactly one item onte the stack.
diff --git a/libdevcore/UTF8.cpp b/libdevcore/UTF8.cpp
new file mode 100644
index 00000000..d742fe66
--- /dev/null
+++ b/libdevcore/UTF8.cpp
@@ -0,0 +1,81 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file UTF8.cpp
+ * @author Alex Beregszaszi
+ * @date 2016
+ *
+ * UTF-8 related helpers
+ */
+
+#include "UTF8.h"
+
+
+namespace dev
+{
+
+
+bool validate(std::string const& _input, size_t& _invalidPosition)
+{
+ const size_t length = _input.length();
+ bool valid = true;
+ size_t i = 0;
+
+ for (; i < length; i++)
+ {
+ if ((unsigned char)_input[i] < 0x80)
+ continue;
+
+ size_t count = 0;
+ switch(_input[i] & 0xe0) {
+ case 0xc0: count = 1; break;
+ case 0xe0: count = 2; break;
+ case 0xf0: count = 3; break;
+ default: break;
+ }
+
+ if (count == 0)
+ {
+ valid = false;
+ break;
+ }
+
+ if ((i + count) >= length)
+ {
+ valid = false;
+ break;
+ }
+
+ for (size_t j = 0; j < count; j++)
+ {
+ i++;
+ if ((_input[i] & 0xc0) != 0x80)
+ {
+ valid = false;
+ break;
+ }
+ }
+ }
+
+ if (valid)
+ return true;
+
+ _invalidPosition = i;
+ return false;
+}
+
+
+}
diff --git a/libdevcore/UTF8.h b/libdevcore/UTF8.h
new file mode 100644
index 00000000..3e39273c
--- /dev/null
+++ b/libdevcore/UTF8.h
@@ -0,0 +1,35 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file UTF8.h
+ * @author Alex Beregszaszi
+ * @date 2016
+ *
+ * UTF-8 related helpers
+ */
+
+#pragma once
+
+#include <string>
+
+namespace dev
+{
+
+/// Validate an input for UTF8 encoding
+/// @returns true if it is invalid and the first invalid position in invalidPosition
+bool validate(std::string const& _input, size_t& _invalidPosition);
+
+}
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index 6b459da4..fc43976d 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -86,7 +86,7 @@ string ASTJsonConverter::sourceLocationToString(SourceLocation const& _location)
ASTJsonConverter::ASTJsonConverter(
ASTNode const& _ast,
- map<string, unsigned> const& _sourceIndices
+ map<string, unsigned> _sourceIndices
): m_ast(&_ast), m_sourceIndices(_sourceIndices)
{
Json::Value children(Json::arrayValue);
diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h
index 2e3046f1..ca4d9c2d 100644
--- a/libsolidity/ast/ASTJsonConverter.h
+++ b/libsolidity/ast/ASTJsonConverter.h
@@ -45,7 +45,7 @@ public:
/// @a _sourceIndices is used to abbreviate source names in source locations.
explicit ASTJsonConverter(
ASTNode const& _ast,
- std::map<std::string, unsigned> const& _sourceIndices = std::map<std::string, unsigned>()
+ std::map<std::string, unsigned> _sourceIndices = std::map<std::string, unsigned>()
);
/// Output the json representation of the AST to _stream.
void print(std::ostream& _stream);
@@ -141,7 +141,7 @@ private:
Json::Value m_astJson;
std::stack<Json::Value*> m_jsonNodePtrs;
ASTNode const* m_ast;
- std::map<std::string, unsigned> const& m_sourceIndices;
+ std::map<std::string, unsigned> m_sourceIndices;
};
}
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 5630743b..28f7e1b7 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -26,6 +26,7 @@
#include <libdevcore/CommonIO.h>
#include <libdevcore/CommonData.h>
#include <libdevcore/SHA3.h>
+#include <libdevcore/UTF8.h>
#include <libsolidity/interface/Utils.h>
#include <libsolidity/ast/AST.h>
@@ -852,6 +853,16 @@ bool StringLiteralType::operator==(const Type& _other) const
return m_value == dynamic_cast<StringLiteralType const&>(_other).m_value;
}
+std::string StringLiteralType::toString(bool) const
+{
+ size_t invalidSequence;
+
+ if (!dev::validate(m_value, invalidSequence))
+ return "literal_string (contains invalid UTF-8 sequence at position " + dev::toString(invalidSequence) + ")";
+
+ return "literal_string \"" + m_value + "\"";
+}
+
TypePointer StringLiteralType::mobileType() const
{
return make_shared<ArrayType>(DataLocation::Memory, true);
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index 1ee762e5..1282e5d8 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -419,7 +419,7 @@ public:
virtual bool canLiveOutsideStorage() const override { return false; }
virtual unsigned sizeOnStack() const override { return 0; }
- virtual std::string toString(bool) const override { return "literal_string \"" + m_value + "\""; }
+ virtual std::string toString(bool) const override;
virtual TypePointer mobileType() const override;
std::string const& value() const { return m_value; }
diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp
index ea8bc1ba..553e5518 100644
--- a/libsolidity/codegen/LValue.cpp
+++ b/libsolidity/codegen/LValue.cpp
@@ -17,7 +17,7 @@
/**
* @author Christian <c@ethdev.com>
* @date 2015
- * LValues for use in the expresison compiler.
+ * LValues for use in the expression compiler.
*/
#include <libsolidity/codegen/LValue.h>
diff --git a/libsolidity/codegen/LValue.h b/libsolidity/codegen/LValue.h
index e8c3aa80..a2f979db 100644
--- a/libsolidity/codegen/LValue.h
+++ b/libsolidity/codegen/LValue.h
@@ -17,7 +17,7 @@
/**
* @author Christian <c@ethdev.com>
* @date 2015
- * LValues for use in the expresison compiler.
+ * LValues for use in the expression compiler.
*/
#pragma once
diff --git a/libsolidity/grammar.txt b/libsolidity/grammar.txt
index 08a74f45..6d92fc59 100644
--- a/libsolidity/grammar.txt
+++ b/libsolidity/grammar.txt
@@ -1,48 +1,102 @@
+SourceUnit = (ImportDirective | ContractDefinition)*
+
ContractDefinition = ( 'contract' | 'library' ) Identifier
( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )?
'{' ContractPart* '}'
-ContractPart = StateVariableDeclaration | StructDefinition | ModifierDefinition | FunctionDefinition | EnumDefinition
+
+ImportDirective = 'import' StringLiteral ('as' Identifier)? ';'
+ | 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral ';'
+ | 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral ';'
+
+ContractPart = StateVariableDeclaration | UsingForDeclaration
+ | StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition
InheritanceSpecifier = Identifier ( '(' Expression ( ',' Expression )* ')' )?
+
+StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' )? Identifier ('=' Expression)? ';'
+UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';'
StructDefinition = 'struct' Identifier '{'
- ( VariableDeclaration (';' VariableDeclaration)* )? '}
-StateVariableDeclaration = TypeName ( 'public' | 'inheritable' | 'private' )? Identifier ';'
+ ( VariableDeclaration ';' (VariableDeclaration ';')* )? '}'
ModifierDefinition = 'modifier' Identifier ParameterList? Block
-FunctionDefinition = 'function' Identifier ParameterList
- ( Identifier | 'constant' | 'external' | 'public' | 'inheritable' | 'private' )*
+FunctionDefinition = 'function' Identifier? ParameterList
+ ( FunctionCall | Identifier | 'constant' | 'external' | 'public' | 'internal' | 'private' )*
( 'returns' ParameterList )? Block
+EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
EnumValue = Identifier
-EnumDefinition = 'enum' '{' EnumValue (',' EnumValue)* '}'
-ParameterList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')'
+EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
+
+IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
+ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
+
// semantic restriction: mappings and structs (recursively) containing mappings
// are not allowed in argument lists
VariableDeclaration = TypeName Identifier
-TypeName = ElementaryTypeName | Identifier | Mapping | ArrayTypeName
+TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
-ArrayTypeName = TypeName '[' (Expression)? ']'
+ArrayTypeName = TypeName StorageLocation? '[' Expression? ']'
+StorageLocation = 'memory' | 'storage'
Block = '{' Statement* '}'
-Statement = IfStatement | WhileStatement | Block |
- ( Continue | Break | Return | VariableDefinition | ExpressionStatement ) ';'
+Statement = IfStatement | WhileStatement | ForStatement | Block | PlaceholderStatement |
+ ( Continue | Break | Return | Throw | SimpleStatement | ExpressionStatement ) ';'
-ExpressionStatement = Expression
+ExpressionStatement = Expression | VariableDefinition
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
WhileStatement = 'while' '(' Expression ')' Statement
-VardefOrExprStmt = Variabledefinition | ExpressionStatement
-ForStatement = 'for' '(' (VardefOrExprStmt)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
-Continue = 'continue' ';'
-Break = 'break' ';'
-Return = 'return' Expression? ';'
-Throw = 'throw' Expression? ';'
-VariableDefinition = VariableDeclaration ( = Expression )? ';'
-
-Expression = Assignment | UnaryOperation | BinaryOperation | FunctionCall | NewExpression | IndexAccess |
- MemberAccess | PrimaryExpression
-// The expression syntax is actually much more complicated
-Assignment = Expression (AssignmentOp Expression)
-FunctionCall = Expression '(' Expression ( ',' Expression )* ')'
+PlaceholderStatement = '_'
+SimpleStatement = VariableDefinition | ExpressionStatement
+ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
+Continue = 'continue'
+Break = 'break'
+Return = 'return' Expression?
+Throw = 'throw'
+VariableDefinition = VariableDeclaration ( '=' Expression )?
+
+// Precedence by order (see github.com/ethereum/solidity/pull/732)
+Expression =
+ ( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' )
+ | ('!' | '~' | 'after' | 'delete' | '++' | '--' | '+' | '-') Expression
+ | Expression '**' Expression
+ | Expression ('*' | '/' | '%') Expression
+ | Expression ('+' | '-') Expression
+ | Expression ('<<' | '>>' | '>>>')
+ | Expression '&' Expression
+ | Expression '^' Expression
+ | Expression '|' Expression
+ | Expression ('<' | '>' | '<=' | '>=') Expression
+ | Expression ('==' | '!=') Expression
+ | Expression '&&' Expression
+ | Expression '||' Expression
+ | Expression '?' Expression ':' Expression
+ | Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
+ | Expression? (',' Expression)
+ | PrimaryExpression
+
+PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
+
+FunctionCall = Identifier '(' Expression? ( ',' Expression )* ')'
NewExpression = 'new' Identifier
MemberAccess = Expression '.' Identifier
-IndexAccess = Expression '[' (Expresison)? ']'
-PrimaryExpression = Identifier | NumberLiteral | StringLiteral | ElementaryTypeName | '(' Expression ')'
+IndexAccess = Expression '[' Expression? ']'
+
+BooleanLiteral = 'true' | 'false'
+NumberLiteral = '0x'? [0-9]+ (' ' NumberUnit)?
+NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether'
+ | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years'
+StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
+
+Identifier = [a-zA-Z_] [a-zA-Z_0-9]*
+
+ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'
+ | Int | Uint | Byte | Fixed | Ufixed
+
+Int = 'int' | 'int8' | 'int16' | 'int24' | 'int32' | 'int40' | 'int48' | 'int56' | 'int64' | 'int72' | 'int80' | 'int88' | 'int96' | 'int104' | 'int112' | 'int120' | 'int128' | 'int136' | 'int144' | 'int152' | 'int160' | 'int168' | 'int176' | 'int184' | 'int192' | 'int200' | 'int208' | 'int216' | 'int224' | 'int232' | 'int240' | 'int248' | 'int256'
+
+Uint = 'uint' | 'uint8' | 'uint16' | 'uint24' | 'uint32' | 'uint40' | 'uint48' | 'uint56' | 'uint64' | 'uint72' | 'uint80' | 'uint88' | 'uint96' | 'uint104' | 'uint112' | 'uint120' | 'uint128' | 'uint136' | 'uint144' | 'uint152' | 'uint160' | 'uint168' | 'uint176' | 'uint184' | 'uint192' | 'uint200' | 'uint208' | 'uint216' | 'uint224' | 'uint232' | 'uint240' | 'uint248' | 'uint256'
+
+Byte = 'byte' | 'bytes' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32'
+
+Fixed = 'fixed' | 'fixed0x8' | 'fixed0x16' | 'fixed0x24' | 'fixed0x32' | 'fixed0x40' | 'fixed0x48' | 'fixed0x56' | 'fixed0x64' | 'fixed0x72' | 'fixed0x80' | 'fixed0x88' | 'fixed0x96' | 'fixed0x104' | 'fixed0x112' | 'fixed0x120' | 'fixed0x128' | 'fixed0x136' | 'fixed0x144' | 'fixed0x152' | 'fixed0x160' | 'fixed0x168' | 'fixed0x176' | 'fixed0x184' | 'fixed0x192' | 'fixed0x200' | 'fixed0x208' | 'fixed0x216' | 'fixed0x224' | 'fixed0x232' | 'fixed0x240' | 'fixed0x248' | 'fixed0x256' | 'fixed8x8' | 'fixed8x16' | 'fixed8x24' | 'fixed8x32' | 'fixed8x40' | 'fixed8x48' | 'fixed8x56' | 'fixed8x64' | 'fixed8x72' | 'fixed8x80' | 'fixed8x88' | 'fixed8x96' | 'fixed8x104' | 'fixed8x112' | 'fixed8x120' | 'fixed8x128' | 'fixed8x136' | 'fixed8x144' | 'fixed8x152' | 'fixed8x160' | 'fixed8x168' | 'fixed8x176' | 'fixed8x184' | 'fixed8x192' | 'fixed8x200' | 'fixed8x208' | 'fixed8x216' | 'fixed8x224' | 'fixed8x232' | 'fixed8x240' | 'fixed8x248' | 'fixed16x8' | 'fixed16x16' | 'fixed16x24' | 'fixed16x32' | 'fixed16x40' | 'fixed16x48' | 'fixed16x56' | 'fixed16x64' | 'fixed16x72' | 'fixed16x80' | 'fixed16x88' | 'fixed16x96' | 'fixed16x104' | 'fixed16x112' | 'fixed16x120' | 'fixed16x128' | 'fixed16x136' | 'fixed16x144' | 'fixed16x152' | 'fixed16x160' | 'fixed16x168' | 'fixed16x176' | 'fixed16x184' | 'fixed16x192' | 'fixed16x200' | 'fixed16x208' | 'fixed16x216' | 'fixed16x224' | 'fixed16x232' | 'fixed16x240' | 'fixed24x8' | 'fixed24x16' | 'fixed24x24' | 'fixed24x32' | 'fixed24x40' | 'fixed24x48' | 'fixed24x56' | 'fixed24x64' | 'fixed24x72' | 'fixed24x80' | 'fixed24x88' | 'fixed24x96' | 'fixed24x104' | 'fixed24x112' | 'fixed24x120' | 'fixed24x128' | 'fixed24x136' | 'fixed24x144' | 'fixed24x152' | 'fixed24x160' | 'fixed24x168' | 'fixed24x176' | 'fixed24x184' | 'fixed24x192' | 'fixed24x200' | 'fixed24x208' | 'fixed24x216' | 'fixed24x224' | 'fixed24x232' | 'fixed32x8' | 'fixed32x16' | 'fixed32x24' | 'fixed32x32' | 'fixed32x40' | 'fixed32x48' | 'fixed32x56' | 'fixed32x64' | 'fixed32x72' | 'fixed32x80' | 'fixed32x88' | 'fixed32x96' | 'fixed32x104' | 'fixed32x112' | 'fixed32x120' | 'fixed32x128' | 'fixed32x136' | 'fixed32x144' | 'fixed32x152' | 'fixed32x160' | 'fixed32x168' | 'fixed32x176' | 'fixed32x184' | 'fixed32x192' | 'fixed32x200' | 'fixed32x208' | 'fixed32x216' | 'fixed32x224' | 'fixed40x8' | 'fixed40x16' | 'fixed40x24' | 'fixed40x32' | 'fixed40x40' | 'fixed40x48' | 'fixed40x56' | 'fixed40x64' | 'fixed40x72' | 'fixed40x80' | 'fixed40x88' | 'fixed40x96' | 'fixed40x104' | 'fixed40x112' | 'fixed40x120' | 'fixed40x128' | 'fixed40x136' | 'fixed40x144' | 'fixed40x152' | 'fixed40x160' | 'fixed40x168' | 'fixed40x176' | 'fixed40x184' | 'fixed40x192' | 'fixed40x200' | 'fixed40x208' | 'fixed40x216' | 'fixed48x8' | 'fixed48x16' | 'fixed48x24' | 'fixed48x32' | 'fixed48x40' | 'fixed48x48' | 'fixed48x56' | 'fixed48x64' | 'fixed48x72' | 'fixed48x80' | 'fixed48x88' | 'fixed48x96' | 'fixed48x104' | 'fixed48x112' | 'fixed48x120' | 'fixed48x128' | 'fixed48x136' | 'fixed48x144' | 'fixed48x152' | 'fixed48x160' | 'fixed48x168' | 'fixed48x176' | 'fixed48x184' | 'fixed48x192' | 'fixed48x200' | 'fixed48x208' | 'fixed56x8' | 'fixed56x16' | 'fixed56x24' | 'fixed56x32' | 'fixed56x40' | 'fixed56x48' | 'fixed56x56' | 'fixed56x64' | 'fixed56x72' | 'fixed56x80' | 'fixed56x88' | 'fixed56x96' | 'fixed56x104' | 'fixed56x112' | 'fixed56x120' | 'fixed56x128' | 'fixed56x136' | 'fixed56x144' | 'fixed56x152' | 'fixed56x160' | 'fixed56x168' | 'fixed56x176' | 'fixed56x184' | 'fixed56x192' | 'fixed56x200' | 'fixed64x8' | 'fixed64x16' | 'fixed64x24' | 'fixed64x32' | 'fixed64x40' | 'fixed64x48' | 'fixed64x56' | 'fixed64x64' | 'fixed64x72' | 'fixed64x80' | 'fixed64x88' | 'fixed64x96' | 'fixed64x104' | 'fixed64x112' | 'fixed64x120' | 'fixed64x128' | 'fixed64x136' | 'fixed64x144' | 'fixed64x152' | 'fixed64x160' | 'fixed64x168' | 'fixed64x176' | 'fixed64x184' | 'fixed64x192' | 'fixed72x8' | 'fixed72x16' | 'fixed72x24' | 'fixed72x32' | 'fixed72x40' | 'fixed72x48' | 'fixed72x56' | 'fixed72x64' | 'fixed72x72' | 'fixed72x80' | 'fixed72x88' | 'fixed72x96' | 'fixed72x104' | 'fixed72x112' | 'fixed72x120' | 'fixed72x128' | 'fixed72x136' | 'fixed72x144' | 'fixed72x152' | 'fixed72x160' | 'fixed72x168' | 'fixed72x176' | 'fixed72x184' | 'fixed80x8' | 'fixed80x16' | 'fixed80x24' | 'fixed80x32' | 'fixed80x40' | 'fixed80x48' | 'fixed80x56' | 'fixed80x64' | 'fixed80x72' | 'fixed80x80' | 'fixed80x88' | 'fixed80x96' | 'fixed80x104' | 'fixed80x112' | 'fixed80x120' | 'fixed80x128' | 'fixed80x136' | 'fixed80x144' | 'fixed80x152' | 'fixed80x160' | 'fixed80x168' | 'fixed80x176' | 'fixed88x8' | 'fixed88x16' | 'fixed88x24' | 'fixed88x32' | 'fixed88x40' | 'fixed88x48' | 'fixed88x56' | 'fixed88x64' | 'fixed88x72' | 'fixed88x80' | 'fixed88x88' | 'fixed88x96' | 'fixed88x104' | 'fixed88x112' | 'fixed88x120' | 'fixed88x128' | 'fixed88x136' | 'fixed88x144' | 'fixed88x152' | 'fixed88x160' | 'fixed88x168' | 'fixed96x8' | 'fixed96x16' | 'fixed96x24' | 'fixed96x32' | 'fixed96x40' | 'fixed96x48' | 'fixed96x56' | 'fixed96x64' | 'fixed96x72' | 'fixed96x80' | 'fixed96x88' | 'fixed96x96' | 'fixed96x104' | 'fixed96x112' | 'fixed96x120' | 'fixed96x128' | 'fixed96x136' | 'fixed96x144' | 'fixed96x152' | 'fixed96x160' | 'fixed104x8' | 'fixed104x16' | 'fixed104x24' | 'fixed104x32' | 'fixed104x40' | 'fixed104x48' | 'fixed104x56' | 'fixed104x64' | 'fixed104x72' | 'fixed104x80' | 'fixed104x88' | 'fixed104x96' | 'fixed104x104' | 'fixed104x112' | 'fixed104x120' | 'fixed104x128' | 'fixed104x136' | 'fixed104x144' | 'fixed104x152' | 'fixed112x8' | 'fixed112x16' | 'fixed112x24' | 'fixed112x32' | 'fixed112x40' | 'fixed112x48' | 'fixed112x56' | 'fixed112x64' | 'fixed112x72' | 'fixed112x80' | 'fixed112x88' | 'fixed112x96' | 'fixed112x104' | 'fixed112x112' | 'fixed112x120' | 'fixed112x128' | 'fixed112x136' | 'fixed112x144' | 'fixed120x8' | 'fixed120x16' | 'fixed120x24' | 'fixed120x32' | 'fixed120x40' | 'fixed120x48' | 'fixed120x56' | 'fixed120x64' | 'fixed120x72' | 'fixed120x80' | 'fixed120x88' | 'fixed120x96' | 'fixed120x104' | 'fixed120x112' | 'fixed120x120' | 'fixed120x128' | 'fixed120x136' | 'fixed128x8' | 'fixed128x16' | 'fixed128x24' | 'fixed128x32' | 'fixed128x40' | 'fixed128x48' | 'fixed128x56' | 'fixed128x64' | 'fixed128x72' | 'fixed128x80' | 'fixed128x88' | 'fixed128x96' | 'fixed128x104' | 'fixed128x112' | 'fixed128x120' | 'fixed128x128' | 'fixed136x8' | 'fixed136x16' | 'fixed136x24' | 'fixed136x32' | 'fixed136x40' | 'fixed136x48' | 'fixed136x56' | 'fixed136x64' | 'fixed136x72' | 'fixed136x80' | 'fixed136x88' | 'fixed136x96' | 'fixed136x104' | 'fixed136x112' | 'fixed136x120' | 'fixed144x8' | 'fixed144x16' | 'fixed144x24' | 'fixed144x32' | 'fixed144x40' | 'fixed144x48' | 'fixed144x56' | 'fixed144x64' | 'fixed144x72' | 'fixed144x80' | 'fixed144x88' | 'fixed144x96' | 'fixed144x104' | 'fixed144x112' | 'fixed152x8' | 'fixed152x16' | 'fixed152x24' | 'fixed152x32' | 'fixed152x40' | 'fixed152x48' | 'fixed152x56' | 'fixed152x64' | 'fixed152x72' | 'fixed152x80' | 'fixed152x88' | 'fixed152x96' | 'fixed152x104' | 'fixed160x8' | 'fixed160x16' | 'fixed160x24' | 'fixed160x32' | 'fixed160x40' | 'fixed160x48' | 'fixed160x56' | 'fixed160x64' | 'fixed160x72' | 'fixed160x80' | 'fixed160x88' | 'fixed160x96' | 'fixed168x8' | 'fixed168x16' | 'fixed168x24' | 'fixed168x32' | 'fixed168x40' | 'fixed168x48' | 'fixed168x56' | 'fixed168x64' | 'fixed168x72' | 'fixed168x80' | 'fixed168x88' | 'fixed176x8' | 'fixed176x16' | 'fixed176x24' | 'fixed176x32' | 'fixed176x40' | 'fixed176x48' | 'fixed176x56' | 'fixed176x64' | 'fixed176x72' | 'fixed176x80' | 'fixed184x8' | 'fixed184x16' | 'fixed184x24' | 'fixed184x32' | 'fixed184x40' | 'fixed184x48' | 'fixed184x56' | 'fixed184x64' | 'fixed184x72' | 'fixed192x8' | 'fixed192x16' | 'fixed192x24' | 'fixed192x32' | 'fixed192x40' | 'fixed192x48' | 'fixed192x56' | 'fixed192x64' | 'fixed200x8' | 'fixed200x16' | 'fixed200x24' | 'fixed200x32' | 'fixed200x40' | 'fixed200x48' | 'fixed200x56' | 'fixed208x8' | 'fixed208x16' | 'fixed208x24' | 'fixed208x32' | 'fixed208x40' | 'fixed208x48' | 'fixed216x8' | 'fixed216x16' | 'fixed216x24' | 'fixed216x32' | 'fixed216x40' | 'fixed224x8' | 'fixed224x16' | 'fixed224x24' | 'fixed224x32' | 'fixed232x8' | 'fixed232x16' | 'fixed232x24' | 'fixed240x8' | 'fixed240x16' | 'fixed248x8'
+
+Ufixed = 'ufixed' | 'ufixed0x8' | 'ufixed0x16' | 'ufixed0x24' | 'ufixed0x32' | 'ufixed0x40' | 'ufixed0x48' | 'ufixed0x56' | 'ufixed0x64' | 'ufixed0x72' | 'ufixed0x80' | 'ufixed0x88' | 'ufixed0x96' | 'ufixed0x104' | 'ufixed0x112' | 'ufixed0x120' | 'ufixed0x128' | 'ufixed0x136' | 'ufixed0x144' | 'ufixed0x152' | 'ufixed0x160' | 'ufixed0x168' | 'ufixed0x176' | 'ufixed0x184' | 'ufixed0x192' | 'ufixed0x200' | 'ufixed0x208' | 'ufixed0x216' | 'ufixed0x224' | 'ufixed0x232' | 'ufixed0x240' | 'ufixed0x248' | 'ufixed0x256' | 'ufixed8x8' | 'ufixed8x16' | 'ufixed8x24' | 'ufixed8x32' | 'ufixed8x40' | 'ufixed8x48' | 'ufixed8x56' | 'ufixed8x64' | 'ufixed8x72' | 'ufixed8x80' | 'ufixed8x88' | 'ufixed8x96' | 'ufixed8x104' | 'ufixed8x112' | 'ufixed8x120' | 'ufixed8x128' | 'ufixed8x136' | 'ufixed8x144' | 'ufixed8x152' | 'ufixed8x160' | 'ufixed8x168' | 'ufixed8x176' | 'ufixed8x184' | 'ufixed8x192' | 'ufixed8x200' | 'ufixed8x208' | 'ufixed8x216' | 'ufixed8x224' | 'ufixed8x232' | 'ufixed8x240' | 'ufixed8x248' | 'ufixed16x8' | 'ufixed16x16' | 'ufixed16x24' | 'ufixed16x32' | 'ufixed16x40' | 'ufixed16x48' | 'ufixed16x56' | 'ufixed16x64' | 'ufixed16x72' | 'ufixed16x80' | 'ufixed16x88' | 'ufixed16x96' | 'ufixed16x104' | 'ufixed16x112' | 'ufixed16x120' | 'ufixed16x128' | 'ufixed16x136' | 'ufixed16x144' | 'ufixed16x152' | 'ufixed16x160' | 'ufixed16x168' | 'ufixed16x176' | 'ufixed16x184' | 'ufixed16x192' | 'ufixed16x200' | 'ufixed16x208' | 'ufixed16x216' | 'ufixed16x224' | 'ufixed16x232' | 'ufixed16x240' | 'ufixed24x8' | 'ufixed24x16' | 'ufixed24x24' | 'ufixed24x32' | 'ufixed24x40' | 'ufixed24x48' | 'ufixed24x56' | 'ufixed24x64' | 'ufixed24x72' | 'ufixed24x80' | 'ufixed24x88' | 'ufixed24x96' | 'ufixed24x104' | 'ufixed24x112' | 'ufixed24x120' | 'ufixed24x128' | 'ufixed24x136' | 'ufixed24x144' | 'ufixed24x152' | 'ufixed24x160' | 'ufixed24x168' | 'ufixed24x176' | 'ufixed24x184' | 'ufixed24x192' | 'ufixed24x200' | 'ufixed24x208' | 'ufixed24x216' | 'ufixed24x224' | 'ufixed24x232' | 'ufixed32x8' | 'ufixed32x16' | 'ufixed32x24' | 'ufixed32x32' | 'ufixed32x40' | 'ufixed32x48' | 'ufixed32x56' | 'ufixed32x64' | 'ufixed32x72' | 'ufixed32x80' | 'ufixed32x88' | 'ufixed32x96' | 'ufixed32x104' | 'ufixed32x112' | 'ufixed32x120' | 'ufixed32x128' | 'ufixed32x136' | 'ufixed32x144' | 'ufixed32x152' | 'ufixed32x160' | 'ufixed32x168' | 'ufixed32x176' | 'ufixed32x184' | 'ufixed32x192' | 'ufixed32x200' | 'ufixed32x208' | 'ufixed32x216' | 'ufixed32x224' | 'ufixed40x8' | 'ufixed40x16' | 'ufixed40x24' | 'ufixed40x32' | 'ufixed40x40' | 'ufixed40x48' | 'ufixed40x56' | 'ufixed40x64' | 'ufixed40x72' | 'ufixed40x80' | 'ufixed40x88' | 'ufixed40x96' | 'ufixed40x104' | 'ufixed40x112' | 'ufixed40x120' | 'ufixed40x128' | 'ufixed40x136' | 'ufixed40x144' | 'ufixed40x152' | 'ufixed40x160' | 'ufixed40x168' | 'ufixed40x176' | 'ufixed40x184' | 'ufixed40x192' | 'ufixed40x200' | 'ufixed40x208' | 'ufixed40x216' | 'ufixed48x8' | 'ufixed48x16' | 'ufixed48x24' | 'ufixed48x32' | 'ufixed48x40' | 'ufixed48x48' | 'ufixed48x56' | 'ufixed48x64' | 'ufixed48x72' | 'ufixed48x80' | 'ufixed48x88' | 'ufixed48x96' | 'ufixed48x104' | 'ufixed48x112' | 'ufixed48x120' | 'ufixed48x128' | 'ufixed48x136' | 'ufixed48x144' | 'ufixed48x152' | 'ufixed48x160' | 'ufixed48x168' | 'ufixed48x176' | 'ufixed48x184' | 'ufixed48x192' | 'ufixed48x200' | 'ufixed48x208' | 'ufixed56x8' | 'ufixed56x16' | 'ufixed56x24' | 'ufixed56x32' | 'ufixed56x40' | 'ufixed56x48' | 'ufixed56x56' | 'ufixed56x64' | 'ufixed56x72' | 'ufixed56x80' | 'ufixed56x88' | 'ufixed56x96' | 'ufixed56x104' | 'ufixed56x112' | 'ufixed56x120' | 'ufixed56x128' | 'ufixed56x136' | 'ufixed56x144' | 'ufixed56x152' | 'ufixed56x160' | 'ufixed56x168' | 'ufixed56x176' | 'ufixed56x184' | 'ufixed56x192' | 'ufixed56x200' | 'ufixed64x8' | 'ufixed64x16' | 'ufixed64x24' | 'ufixed64x32' | 'ufixed64x40' | 'ufixed64x48' | 'ufixed64x56' | 'ufixed64x64' | 'ufixed64x72' | 'ufixed64x80' | 'ufixed64x88' | 'ufixed64x96' | 'ufixed64x104' | 'ufixed64x112' | 'ufixed64x120' | 'ufixed64x128' | 'ufixed64x136' | 'ufixed64x144' | 'ufixed64x152' | 'ufixed64x160' | 'ufixed64x168' | 'ufixed64x176' | 'ufixed64x184' | 'ufixed64x192' | 'ufixed72x8' | 'ufixed72x16' | 'ufixed72x24' | 'ufixed72x32' | 'ufixed72x40' | 'ufixed72x48' | 'ufixed72x56' | 'ufixed72x64' | 'ufixed72x72' | 'ufixed72x80' | 'ufixed72x88' | 'ufixed72x96' | 'ufixed72x104' | 'ufixed72x112' | 'ufixed72x120' | 'ufixed72x128' | 'ufixed72x136' | 'ufixed72x144' | 'ufixed72x152' | 'ufixed72x160' | 'ufixed72x168' | 'ufixed72x176' | 'ufixed72x184' | 'ufixed80x8' | 'ufixed80x16' | 'ufixed80x24' | 'ufixed80x32' | 'ufixed80x40' | 'ufixed80x48' | 'ufixed80x56' | 'ufixed80x64' | 'ufixed80x72' | 'ufixed80x80' | 'ufixed80x88' | 'ufixed80x96' | 'ufixed80x104' | 'ufixed80x112' | 'ufixed80x120' | 'ufixed80x128' | 'ufixed80x136' | 'ufixed80x144' | 'ufixed80x152' | 'ufixed80x160' | 'ufixed80x168' | 'ufixed80x176' | 'ufixed88x8' | 'ufixed88x16' | 'ufixed88x24' | 'ufixed88x32' | 'ufixed88x40' | 'ufixed88x48' | 'ufixed88x56' | 'ufixed88x64' | 'ufixed88x72' | 'ufixed88x80' | 'ufixed88x88' | 'ufixed88x96' | 'ufixed88x104' | 'ufixed88x112' | 'ufixed88x120' | 'ufixed88x128' | 'ufixed88x136' | 'ufixed88x144' | 'ufixed88x152' | 'ufixed88x160' | 'ufixed88x168' | 'ufixed96x8' | 'ufixed96x16' | 'ufixed96x24' | 'ufixed96x32' | 'ufixed96x40' | 'ufixed96x48' | 'ufixed96x56' | 'ufixed96x64' | 'ufixed96x72' | 'ufixed96x80' | 'ufixed96x88' | 'ufixed96x96' | 'ufixed96x104' | 'ufixed96x112' | 'ufixed96x120' | 'ufixed96x128' | 'ufixed96x136' | 'ufixed96x144' | 'ufixed96x152' | 'ufixed96x160' | 'ufixed104x8' | 'ufixed104x16' | 'ufixed104x24' | 'ufixed104x32' | 'ufixed104x40' | 'ufixed104x48' | 'ufixed104x56' | 'ufixed104x64' | 'ufixed104x72' | 'ufixed104x80' | 'ufixed104x88' | 'ufixed104x96' | 'ufixed104x104' | 'ufixed104x112' | 'ufixed104x120' | 'ufixed104x128' | 'ufixed104x136' | 'ufixed104x144' | 'ufixed104x152' | 'ufixed112x8' | 'ufixed112x16' | 'ufixed112x24' | 'ufixed112x32' | 'ufixed112x40' | 'ufixed112x48' | 'ufixed112x56' | 'ufixed112x64' | 'ufixed112x72' | 'ufixed112x80' | 'ufixed112x88' | 'ufixed112x96' | 'ufixed112x104' | 'ufixed112x112' | 'ufixed112x120' | 'ufixed112x128' | 'ufixed112x136' | 'ufixed112x144' | 'ufixed120x8' | 'ufixed120x16' | 'ufixed120x24' | 'ufixed120x32' | 'ufixed120x40' | 'ufixed120x48' | 'ufixed120x56' | 'ufixed120x64' | 'ufixed120x72' | 'ufixed120x80' | 'ufixed120x88' | 'ufixed120x96' | 'ufixed120x104' | 'ufixed120x112' | 'ufixed120x120' | 'ufixed120x128' | 'ufixed120x136' | 'ufixed128x8' | 'ufixed128x16' | 'ufixed128x24' | 'ufixed128x32' | 'ufixed128x40' | 'ufixed128x48' | 'ufixed128x56' | 'ufixed128x64' | 'ufixed128x72' | 'ufixed128x80' | 'ufixed128x88' | 'ufixed128x96' | 'ufixed128x104' | 'ufixed128x112' | 'ufixed128x120' | 'ufixed128x128' | 'ufixed136x8' | 'ufixed136x16' | 'ufixed136x24' | 'ufixed136x32' | 'ufixed136x40' | 'ufixed136x48' | 'ufixed136x56' | 'ufixed136x64' | 'ufixed136x72' | 'ufixed136x80' | 'ufixed136x88' | 'ufixed136x96' | 'ufixed136x104' | 'ufixed136x112' | 'ufixed136x120' | 'ufixed144x8' | 'ufixed144x16' | 'ufixed144x24' | 'ufixed144x32' | 'ufixed144x40' | 'ufixed144x48' | 'ufixed144x56' | 'ufixed144x64' | 'ufixed144x72' | 'ufixed144x80' | 'ufixed144x88' | 'ufixed144x96' | 'ufixed144x104' | 'ufixed144x112' | 'ufixed152x8' | 'ufixed152x16' | 'ufixed152x24' | 'ufixed152x32' | 'ufixed152x40' | 'ufixed152x48' | 'ufixed152x56' | 'ufixed152x64' | 'ufixed152x72' | 'ufixed152x80' | 'ufixed152x88' | 'ufixed152x96' | 'ufixed152x104' | 'ufixed160x8' | 'ufixed160x16' | 'ufixed160x24' | 'ufixed160x32' | 'ufixed160x40' | 'ufixed160x48' | 'ufixed160x56' | 'ufixed160x64' | 'ufixed160x72' | 'ufixed160x80' | 'ufixed160x88' | 'ufixed160x96' | 'ufixed168x8' | 'ufixed168x16' | 'ufixed168x24' | 'ufixed168x32' | 'ufixed168x40' | 'ufixed168x48' | 'ufixed168x56' | 'ufixed168x64' | 'ufixed168x72' | 'ufixed168x80' | 'ufixed168x88' | 'ufixed176x8' | 'ufixed176x16' | 'ufixed176x24' | 'ufixed176x32' | 'ufixed176x40' | 'ufixed176x48' | 'ufixed176x56' | 'ufixed176x64' | 'ufixed176x72' | 'ufixed176x80' | 'ufixed184x8' | 'ufixed184x16' | 'ufixed184x24' | 'ufixed184x32' | 'ufixed184x40' | 'ufixed184x48' | 'ufixed184x56' | 'ufixed184x64' | 'ufixed184x72' | 'ufixed192x8' | 'ufixed192x16' | 'ufixed192x24' | 'ufixed192x32' | 'ufixed192x40' | 'ufixed192x48' | 'ufixed192x56' | 'ufixed192x64' | 'ufixed200x8' | 'ufixed200x16' | 'ufixed200x24' | 'ufixed200x32' | 'ufixed200x40' | 'ufixed200x48' | 'ufixed200x56' | 'ufixed208x8' | 'ufixed208x16' | 'ufixed208x24' | 'ufixed208x32' | 'ufixed208x40' | 'ufixed208x48' | 'ufixed216x8' | 'ufixed216x16' | 'ufixed216x24' | 'ufixed216x32' | 'ufixed216x40' | 'ufixed224x8' | 'ufixed224x16' | 'ufixed224x24' | 'ufixed224x32' | 'ufixed232x8' | 'ufixed232x16' | 'ufixed232x24' | 'ufixed240x8' | 'ufixed240x16' | 'ufixed248x8'
diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh
index bf9bd9b2..bbf28d95 100755
--- a/scripts/install_deps.sh
+++ b/scripts/install_deps.sh
@@ -150,12 +150,14 @@ case $(uname -s) in
Alpine)
#Alpine
echo "Installing solidity dependencies on Alpine Linux."
- echo "ERROR - 'install_deps.sh' doesn't have Alpine Linux support yet."
- echo "See http://solidity.readthedocs.io/en/latest/installing-solidity.html for manual instructions."
- echo "If you would like to get 'install_deps.sh' working for Alpine Linux, that would be fantastic."
- echo "Drop us a message at https://gitter.im/ethereum/solidity."
- echo "See also https://github.com/ethereum/webthree-umbrella/issues/495 where we are working through Alpine support."
- exit 1
+
+ # All our dependencies can be found in the Alpine Linux official repositories.
+ # See https://pkgs.alpinelinux.org/
+
+ apk update
+ apk upgrade
+ apk add boost-dev build-base cmake jsoncpp-dev
+
;;
#------------------------------------------------------------------------------
diff --git a/scripts/release.bat b/scripts/release.bat
index 6f0ef6b0..54d85862 100644
--- a/scripts/release.bat
+++ b/scripts/release.bat
@@ -28,7 +28,6 @@ REM ---------------------------------------------------------------------------
set CONFIGURATION=%1
-REM TODO - Add soltest\%CONFIGURATION%\soltest.exe, when that is buildable.
-7z a solidity-develop-windows.zip ^
- .\build\solc\%CONFIGURATION%\solc.exe ^
+7z a solidity-windows.zip ^
+ .\build\solc\%CONFIGURATION%\solc.exe .\build\test\%CONFIGURATION%\soltest.exe ^
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\msvc*.dll"
diff --git a/scripts/release.sh b/scripts/release.sh
index 275e53bb..e9f43f6c 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -89,4 +89,4 @@ fi
# And ZIP it all up, with a filename suffix passed in on the command-line.
-zip -j $REPO_ROOT/solidity-develop-$ZIP_SUFFIX.zip $ZIP_TEMP_DIR/*
+zip -j $REPO_ROOT/solidity-$ZIP_SUFFIX.zip $ZIP_TEMP_DIR/*
diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh
new file mode 100755
index 00000000..2fd286fd
--- /dev/null
+++ b/scripts/release_ppa.sh
@@ -0,0 +1,241 @@
+#!/usr/bin/env bash
+##############################################################################
+## This is used to package .deb packages and upload them to the launchpad
+## ppa servers for building.
+##
+## If no argument is given, creates a package for the develop branch
+## and uploads it to the ethereum/ethereum-dev ppa.
+##
+## If an argument is given, it is used as a tag and the resulting package
+## is uploaded to the ethereum/ethereum ppa.
+##
+## The gnupg key for "builds@ethereum.org" has to be present in order to sign
+## the package.
+##
+## It will clone the Solidity git from github, determine the version,
+## create a source archive and push it to the ubuntu ppa servers.
+##
+##############################################################################
+
+set -ev
+
+if [ -z "$1" ]
+then
+ branch=develop
+else
+ branch=$1
+fi
+
+if [ "$branch" = develop ]
+then
+ pparepo=ethereum/ethereum-dev
+ ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files
+else
+ pparepo=ethereum/ethereum
+ ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum/+files
+fi
+
+keyid=703F83D0
+email=builds@ethereum.org
+packagename=solc
+
+for distribution in trusty vivid wily xenial yakkety
+do
+cd /tmp/
+mkdir $distribution
+cd $distribution
+
+# Fetch source
+git clone --recursive https://github.com/ethereum/solidity.git -b "$branch"
+mv solidity solc
+
+# Determine version
+cd solc
+version=`grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? CMakeLists.txt`
+commithash=`git rev-parse --short HEAD`
+committimestamp=`git show --format=%ci HEAD | head -n 1`
+commitdate=`git show --format=%ci HEAD | head -n 1 | cut - -b1-10`
+
+# TODO store the commit hash in a file so that the build info mechanism can pick it up even without git
+
+if [ $branch = develop ]
+then
+ debversion="$version-nightly-$commitdate-$commithash"
+else
+ debversion="$version"
+fi
+
+# gzip will create different tars all the time and we are not allowed
+# to upload the same file twice with different contents, so we only
+# create it once.
+if [ ! -e /tmp/${packagename}_${debversion}.orig.tar.gz ]
+then
+ tar --exclude .git -czf /tmp/${packagename}_${debversion}.orig.tar.gz .
+fi
+cp /tmp/${packagename}_${debversion}.orig.tar.gz ../
+
+# Create debian package information
+
+case $distribution in
+ trusty)
+ jsoncpplib=libjsoncpp0
+ ;;
+ vivid)
+ jsoncpplib=libjsoncpp0
+ ;;
+ wily)
+ jsoncpplib=libjsoncpp0v5
+ ;;
+ *)
+ jsoncpplib=libjsoncpp1
+ ;;
+esac
+
+mkdir debian
+echo 9 > debian/compat
+cat <<EOF > debian/control
+Source: solc
+Section: science
+Priority: extra
+Maintainer: Christian (Buildserver key) <builds@ethereum.org>
+Build-Depends: debhelper (>= 9.0.0),
+ libcryptopp-dev,
+ cmake,
+ g++-4.8,
+ git,
+ libgmp-dev,
+ libboost-all-dev,
+ automake,
+ libtool,
+ scons,
+ libjsoncpp-dev
+Standards-Version: 3.9.5
+Homepage: https://ethereum.org
+Vcs-Git: git://github.com/ethereum/solidity.git
+Vcs-Browser: https://github.com/ethereum/solidity
+
+Package: solc
+Architecture: any-i386 any-amd64
+Multi-Arch: same
+Depends: \${shlibs:Depends}, \${misc:Depends}, $jsoncpplib
+Replaces: lllc (<< 1:0.3.6)
+Conflicts: libethereum (<= 1.2.9)
+Description: Solidity compiler.
+ The commandline interface to the Solidity smart contract compiler.
+EOF
+cat <<EOF > debian/rules
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+
+%:
+ dh \$@ --buildsystem=cmake #--with sphinxdoc
+
+override_dh_auto_test:
+
+#override_dh_installdocs:
+# make -C docs html
+# dh_installdocs docs/_build/html
+
+override_dh_shlibdeps:
+ dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
+EOF
+cat <<EOF > debian/copyright
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: solc
+Source: https://github.com/ethereum/solidity
+
+Files: *
+Copyright: 2014-2016 Ethereum
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2016 Ethereum
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+EOF
+cat <<EOF > debian/changelog
+solc (0.0.1-0ubuntu1) saucy; urgency=low
+
+ * Initial release.
+
+ -- Christian <build@ethereum.org> Mon, 03 Feb 2016 14:50:20 +0000
+EOF
+echo docs > debian/docs
+mkdir debian/source
+echo "3.0 (quilt)" > debian/source/format
+chmod +x debian/rules
+
+versionsuffix=0ubuntu1~${distribution}
+# bump version / add entry to changelog
+EMAIL="$email" dch -v 1:${debversion}-${versionsuffix} "git build of ${commithash}"
+
+
+# build source package
+# If packages is rejected because original source is already present, add
+# -sd to remove it from the .changes file
+debuild -S -sa -us -uc
+
+# prepare .changes file for Launchpad
+sed -i -e s/UNRELEASED/${distribution}/ -e s/urgency=medium/urgency=low/ ../*.changes
+
+# check if ubuntu already has the source tarball
+(
+cd ..
+orig=${packagename}_${debversion}.orig.tar.gz
+orig_size=$(ls -l $orig | cut -d ' ' -f 5)
+orig_sha1=$(sha1sum $orig | cut -d ' ' -f 1)
+orig_sha256=$(sha256sum $orig | cut -d ' ' -f 1)
+orig_md5=$(md5sum $orig | cut -d ' ' -f 1)
+
+if wget --quiet -O $orig-tmp "$ppafilesurl/$orig"
+then
+ echo "[WARN] Original tarball found in Ubuntu archive, using it instead"
+ mv $orig-tmp $orig
+ new_size=$(ls -l *.orig.tar.gz | cut -d ' ' -f 5)
+ new_sha1=$(sha1sum $orig | cut -d ' ' -f 1)
+ new_sha256=$(sha256sum $orig | cut -d ' ' -f 1)
+ new_md5=$(md5sum $orig | cut -d ' ' -f 1)
+ sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.dsc
+ sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.changes
+fi
+)
+
+# sign the package
+debsign --re-sign -k ${keyid} ../${packagename}_${debversion}-${versionsuffix}_source.changes
+
+# upload
+dput ppa:${pparepo} ../${packagename}_${debversion}-${versionsuffix}_source.changes
+
+done
diff --git a/scripts/travis-emscripten/publish_binary.sh b/scripts/travis-emscripten/publish_binary.sh
index a62d4b47..3cade4c9 100755
--- a/scripts/travis-emscripten/publish_binary.sh
+++ b/scripts/travis-emscripten/publish_binary.sh
@@ -52,19 +52,24 @@ git config user.email "chris@ethereum.org"
git checkout -B gh-pages origin/gh-pages
git clean -f -d -x
# We only want one release per day and we do not want to push the same commit twice.
-if ls ./bin/soljson-"$VER-$DATE"-*.js ./bin/soljson-*-"$COMMIT.js" > /dev/null
+if ls ./bin/soljson-"$VER-$DATE"-*.js || ls ./bin/soljson-*-"$COMMIT.js"
then
- true
-else
- # This file is assumed to be the product of the build_emscripten.sh script.
- cp ../soljson.js ./bin/"soljson-$VER-$DATE-$COMMIT.js"
- ./update-index.sh
- cd bin
- LATEST=$(ls -r soljson-v* | head -n 1)
- cp "$LATEST" soljson-latest.js
- cp soljson-latest.js ../soljson.js
- git add .
- git add ../soljson.js
- git commit -m "Added compiler version $LATEST"
- git push origin gh-pages
+ echo "Not publishing, we already published this version today."
+ exit 0
fi
+
+echo "Would have published."
+# disable publishing for now
+exit 0
+
+# This file is assumed to be the product of the build_emscripten.sh script.
+cp ../soljson.js ./bin/"soljson-$VER-$DATE-$COMMIT.js"
+./update-index.sh
+cd bin
+LATEST=$(ls -r soljson-v* | head -n 1)
+cp "$LATEST" soljson-latest.js
+cp soljson-latest.js ../soljson.js
+git add .
+git add ../soljson.js
+git commit -m "Added compiler version $LATEST"
+git push origin gh-pages