Commit Graph

101 Commits

Author SHA1 Message Date
Alex Beregszaszi
bd48f181b5 Merge pull request #2098 from ethereum/sourceformatter
Introduce formatExceptionInformation
2017-04-10 14:46:59 +01:00
Alex Beregszaszi
b1db6eac8b Introduce formatExceptionInformation 2017-04-10 14:07:36 +01:00
Alex Beregszaszi
623b8eb107 Pull out ReadFile from CompilerStack 2017-04-10 12:49:47 +01:00
Alex Beregszaszi
e0ff70778a Rename ErrorMesage to ErrorMessage 2017-03-16 23:59:36 +00:00
Yoichi Hirai
e364909e06 Merge pull request #1747 from ethereum/fixICEInternalConstructor
Move privateness of constructor into AST itself.
2017-03-08 17:49:14 +01:00
Yoichi Hirai
a1e350a4ae Merge pull request #1699 from ethereum/asmlabels
Assembly labels with stack information
2017-03-08 11:56:44 +01:00
chriseth
a2ac05e1a2 Merge pull request #1733 from ethereum/selfReferentialConstant
Detect cyclic dependencies between constants.
2017-03-06 17:18:39 +01:00
chriseth
5c5d83fd70 Check for circular references in constant variables. 2017-03-06 15:05:09 +01:00
chriseth
960b5fa032 Error constructor. 2017-03-06 14:27:18 +01:00
chriseth
f300bdb020 Move public constructor property into AST itself. 2017-03-06 14:12:42 +01:00
chriseth
7f2def8971 Analysis refactoring. 2017-03-03 15:41:01 +01:00
chriseth
7a24a5764e Add line info to serious exceptions. 2017-02-24 19:32:41 +01:00
chriseth
e67faa9839 Extract scopes into compiler stack. 2017-02-14 13:23:44 +01:00
chriseth
a9c6ff4ac8 Refactor json return type generation. 2017-01-26 18:21:19 +01:00
Alex Beregszaszi
fcf483ee6b Add option to store literal sources in metadata 2017-01-26 13:16:26 +00:00
chriseth
0ef460461a Check if constructor is public or not. 2017-01-20 19:22:39 +01:00
chriseth
7159944f0f Reset AST node IDs between compilation runs. 2017-01-20 12:00:16 +01:00
chriseth
005e190885 Merge pull request #1397 from roadriverrail/contract_collision
Error out when contracts collide on name
2017-01-18 14:28:00 +01:00
Alex Beregszaszi
4675599170 Include SOL_VERSION_COMMIT/SOL_VERSION_PLATFORM in buildinfo.h 2017-01-17 12:54:58 +00:00
Alex Beregszaszi
350c7e7e2c Store strict version number in metadata (exclude the platform) 2017-01-17 12:54:58 +00:00
Rhett Aultman
94b092d87c Provide fall-back method for contract lookup
Properly, contracts are now looked up via <source>:<contract> identifiers
called "fully qualified names."  As a modicum of backward-compatibility,
failure on a lookup is now backed up by seeing if the ":" exists at all,
and if it doesn't, then the known contracts are scanned for any matching
contract name.
2017-01-16 23:47:04 -05:00
Rhett Aultman
5a2331a9f6 Remove checkLibraryNameClashes()
The library name clash checker throws errors when two libraries of the
same name are spotted.  In a previous commit, this function was
rewritten to use fully-qualified names instead, which makes it redundant
to the checker for multiply-declared identifiers.  Since it no longer
serves a clear purpose, the function is being dropped.
2017-01-16 12:32:58 -05:00
Rhett Aultman
85c55c796a Remove unique error for contract collision
Because contracts are uniquely identified by their source unit, there
is no need for a unique error for this; it's actually covered by the
checker for double-declaration of identifiers.
2017-01-16 12:32:57 -05:00
Rhett Aultman
0c98e4b2da Stylistic corrections 2017-01-16 12:32:57 -05:00
Rhett Aultman
e3b0827721 Push the error instead of throwing it
Throwing a CompilerError on multiple contract definition violates the
expectations of the test suite, which thinks that compile() will
return false if the code can't compile.  This brings contract
collision reporting in line with most of the other errors.
2017-01-16 12:32:57 -05:00
Rhett Aultman
071b936b37 Only avoid collision if it's the same file
@chriseth had suggested that it would be better if contracts were
referenced in a file:contract notation, and that we output .bin files
that prepend original path names if necessary to avoid a collision.

This commit is mostly a draft; it still needs to be run through the test
suite.
2017-01-16 12:32:57 -05:00
Rhett Aultman
9e88f1eebe Tab whitespace cleanup (again) 2017-01-16 12:32:57 -05:00
Rhett Aultman
ce3082dec2 Tidy up the error message 2017-01-16 12:32:57 -05:00
Rhett Aultman
b24ca4fa23 Fix tab, drop stupid '!!!', change error message. 2017-01-16 12:32:57 -05:00
Rhett Aultman
f3a84eab91 Error out when contracts collide on name
The previous behaviour, courtesy of the [] operator in std::map, would
uncritically store a new ContractDefinition in m_contracts even when a
ContractDefinition already existed.  This "resolved" collissions on contract
names by clobbering the original one with the new one, and could lead to
scenarios where the clobber would only be discovered when the original
ContractDefinition could not be found or referred to, which was an unhelpful
InternalCompilerError.

This change checks the m_contracts map for a collision first and will not let
the ContractDefinition be changed to a new one once it's set, throwing a
CompilerError with information about the conflict.
2017-01-16 12:32:57 -05:00
VoR0220
b6508ca992
fixed
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 12:03:54 -06:00
VoR0220
4542f459f1
added fix and a test for order independence of nested prefixing
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 11:45:14 -06:00
VoR0220
4585bfdce7
cleanup
Signed-off-by: VoR0220 <rj@erisindustries.com>

fixup

Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 11:03:02 -06:00
VoR0220
e02270bbb4
fixed unused filepath bug
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-11 09:03:41 -06:00
VoR0220
8ace851831
much smaller helper function
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-10 07:17:11 -06:00
VoR0220
79dbd40096
can do this purely on length. Also made prefix filesystem string for more accurate readings.
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-08 22:53:57 -06:00
VoR0220
6d9020b3b8
fixed test and added solution
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-08 22:53:54 -06:00
Yoichi Hirai
41fe412389
interface: change absolutePath() so that ".dir" is considered as an absolute path
fixes #1534
2017-01-03 18:18:22 +01:00
chriseth
56a027bedc Use multiple URLs for metadata. 2016-12-13 16:37:48 +01:00
chriseth
c111d6e27e Merge pull request #1491 from ameten/refactoring
Just refactored some code
2016-12-12 21:43:04 +01:00
Federico Bond
05139500fb Warn about using msg.value in non-payable function 2016-12-08 16:22:13 -03:00
Danil Nemirovsky
db42294a20 - fixed a misprint. 2016-12-08 21:33:09 +03:00
chriseth
f1907bbb12 Add the _runs parameter. 2016-12-01 16:04:00 +01:00
Alex Beregszaszi
f869792eec Fix type of optimizeRuns 2016-12-01 16:03:59 +01:00
chriseth
6a7ff039df Use CBOR encoding. 2016-12-01 16:03:59 +01:00
chriseth
91ecc4533d Add swarm hash to the end of the bytecode. 2016-12-01 16:03:59 +01:00
chriseth
659b635b2d Make sure some keys are present. 2016-12-01 16:03:59 +01:00
chriseth
e666f8cda7 Incorporate comments. 2016-12-01 16:03:59 +01:00
chriseth
5789eaa78d Metadata stamp. 2016-12-01 16:03:59 +01:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00