Commit Graph

441 Commits

Author SHA1 Message Date
chriseth
4dfe9a216c Disallow explicit fixed->enum, but allow bytes->fixed. 2016-05-10 19:40:37 +02:00
chriseth
ef7049f9a6 Some cleanup. 2016-05-10 19:40:37 +02:00
chriseth
22318c0c1a Replace "unsigned int" by "unsigned". 2016-05-10 19:40:37 +02:00
chriseth
80c368dac1 Prefer mobileType() to check rational range. 2016-05-10 19:40:35 +02:00
VoR0220
a6fc3c8f30 reorganized tests and fixed mobile types and implicit conversions of rationals and fixed point types
one final tweak

check for null types
2016-05-09 11:41:03 -05:00
VoR0220
bfc238c8d1 updated algorithm for bit finding...now to figure out literal value
tiny fixups

changed location of the check

got rid of extra space and fixed a couple of things

added binary results bits

change back literal value
2016-05-09 11:41:03 -05:00
VoR0220
5bddb2d6ff changed algorithm for finding bits 2016-05-09 11:41:03 -05:00
VoR0220
4b3e1f140c much better way of doing modulus 2016-05-09 11:41:03 -05:00
VoR0220
82039b732e added bytes conversion tests, resolved that, converted to binary scaling, refactored the find algo to prevent large numbers and take into account integer bytes
think we're good on solidity type name resolution now

removed couts

updates to documentation and more removed couts along with literal value implementation

forgot semicolons
2016-05-09 11:41:03 -05:00
VoR0220
f0ea817580 fixing modulus and Solidity Name and Type Resolution
minor fixes

current attempts at binary fixup
2016-05-09 11:41:03 -05:00
VoR0220
f67bfd24a3 rational renaming 2016-05-09 11:41:03 -05:00
VoR0220
4b749fc333 changed names for Rational Constants and categories 2016-05-09 11:41:02 -05:00
VoR0220
4d283b2b30 currently what we have 2016-05-09 11:41:02 -05:00
RJ Catalano
93295ae8f8 got exponents up and working with their inverse, changed a few of the tests....something is working that likely shouldn't be
slight changes to how to flip the rational negative around...still trying to figure it out

tests added

updated tests

odd differences in trying soltest from solc binary, let me know if you can replicate

test not working for odd reason

fixed test problem with fixed literals...still need a way to log this error

broken up the tests, added some, changed some things in types and began compiler work

moar tests and prepping for rebuilding much of the types.cpp file

further fixing

infinite loop still happening but it's somewhere in the fixedPoint methodd

fractional bits needed algo improved! Eliminated 2 errors

Corrected problems with the previous commit. No infinite loops. Actually appear to have corrected an error
2016-05-09 11:41:02 -05:00
RJ Catalano
a1a2eac5fd size capabilities functioning properly for fixed types 2016-05-09 11:41:02 -05:00
RJ Catalano
91fda50922 fixed problem with var...probably a conversion problem for fixed in size capabilities
adding fixed type tests

Removing bitshift and regrouping fixed type tests together
2016-05-09 11:41:02 -05:00
RJ Catalano
dff1a26f55 fix for token bug, also quick fix for the wei and seconds 2016-05-09 11:41:02 -05:00
RJ Catalano
6fa5e0fac9 Rational implemented...trying to figure out exponential 2016-05-09 11:41:02 -05:00
RJ Catalano
9a075458ad initial work for fixed types...potentially needing a constant literal type for this
notation

Rational implemented...trying to figure out exponential

fix for token bug, also quick fix for the wei and seconds

fixed problem with var...probably a conversion problem for fixed in size capabilities

adding fixed type tests

Removing bitshift and regrouping fixed type tests together

size capabilities functioning properly for fixed types

got exponents up and working with their inverse, changed a few of the tests....something is working that likely shouldn't be

slight changes to how to flip the rational negative around...still trying to figure it out

tests added

updated tests

odd differences in trying soltest from solc binary, let me know if you can replicate

test not working for odd reason

fixed test problem with fixed literals...still need a way to log this error

broken up the tests, added some, changed some things in types and began compiler work

moar tests and prepping for rebuilding much of the types.cpp file

further fixing

initial work for fixed types...potentially needing a constant literal type for this
2016-05-09 11:41:02 -05:00
chriseth
7ea3d950d7 Allow calling internal functions of libraries.
Internal functions of libraries can be called as if the library were a
base contract of the calling contract. As the calling convention for
internal functions is to not create a new call context, the code of
these functions will be pulled into the context of the caller,
duplicating their code. This might pull in code of further internal or
even private functions.

The use case for such functions is to allow libraries which can operate
on memory types such that these types can also be modified in place.
2016-05-03 22:41:18 +02:00
chriseth
652bc583c0 Remove non-determinism in missing code queue. 2016-05-03 01:14:26 +02:00
chriseth
8704dd0f7f Windows fix. 2016-04-21 16:13:39 +02:00
chriseth
ed9da5171b Source location for inline assembly. 2016-04-19 18:35:21 +02:00
chriseth
b125090208 Bugfix: static arrays in constructor arguments 2016-04-15 18:42:44 +02:00
chriseth
35ffcac35b Fix for bug about deleting dynamic array of structs. 2016-04-15 16:49:59 +02:00
Bob Summerwill
539b392a6d Merge pull request #496 from chriseth/removelog
Remove log.h from solidity.
2016-04-11 21:50:05 -07:00
chriseth
6f54b13d7a Remove log.h from solidity. 2016-04-12 01:03:46 +02:00
chriseth
f227050c20 Make solidity independent from ethcore. 2016-04-06 20:56:00 +02:00
chriseth
193b1c940c Merge pull request #475 from chriseth/byteasm
Allow "byte" in inline assembly.
2016-04-06 16:40:20 +02:00
chriseth
26a91109a7 Allow "byte" in inline assembly. 2016-04-06 12:31:31 +02:00
Dimitry
d2cee6f9c6 reduce unnecessary solidity:: namespace 2016-04-04 15:41:35 +04:00
Dimitry
d43d4347bf return instructionInfo style 2016-04-04 15:27:09 +04:00
Dimitry
9816510065 enable solidity test 2016-04-04 15:18:24 +04:00
Dimitry
858c41260d rename namespace for instruction.h/cpp in libevmasm 2016-04-02 15:56:43 +03:00
Dimitry
ccbd3ff63f move libevmcore to solidity 2016-04-01 23:11:01 +03:00
Bob Summerwill
c492d9be00 Merge pull request #470 from chriseth/redundancy
Remove code duplication in source references formatter.
2016-03-31 20:31:15 -03:00
chriseth
285fdf3b0a Merge pull request #457 from VoR0220/tokenNameAndStringFix
Fix for Token::name and token::toString
2016-04-01 01:08:59 +02:00
chriseth
ea7325d2d2 Remove code duplication in source references formatter. 2016-04-01 00:54:12 +02:00
VoR0220
3fc67245bf readding conditionals but with slight changes 2016-03-31 12:15:49 -05:00
Bob Summerwill
15a4f4d322 Merge pull request #465 from chriseth/fixindexaccess
Clean higher order bits before array index access.
2016-03-31 13:46:35 -03:00
chriseth
e31ecc8f77 Do not use source reference if it is empty. 2016-03-31 13:05:41 +02:00
chriseth
2c29492227 Correctly clean higher order bits for index access. 2016-03-31 10:33:45 +02:00
VoR0220
1b39d3b5d4 solAsserts added and some changes rolled back. 2016-03-30 13:15:54 -05:00
VoR0220
9404600b3f helper function in scanner and corresponding edits to parserBase 2016-03-30 13:09:38 -05:00
VoR0220
6c61e28dc2 Got it working exactly like you wanted ;) 2016-03-30 11:54:00 -05:00
VoR0220
6395168371 change lexical cast to unsigned int 2016-03-30 11:54:00 -05:00
VoR0220
ddd16d7655 Fix for Token::name and token::toString 2016-03-30 11:54:00 -05:00
chriseth
f049430723 Code generation (missing external access and source locations). 2016-03-30 02:37:00 +02:00
chriseth
949b00ed59 Parsing for inline assembly. 2016-03-30 02:37:00 +02:00
chriseth
79167aa897 Move libevmasm and lll. 2016-03-23 23:10:10 +01:00
Bob Summerwill
a1ce66b304 Fixed Windows warnings 2016-03-18 01:22:15 -07:00
chriseth
9b00290d74 Remove timestamp again and some fixes for ufixed parsing. 2016-03-11 17:50:09 +01:00
chriseth
299fef0c79 Do not allow value for delegatecall functions. 2016-03-11 17:50:09 +01:00
RJ Catalano
d0054a8d29 added keyword type and some tests, changes in lexical cast 2016-03-11 17:50:09 +01:00
RJ Catalano
b8bcb706e9 stylistic change, and got lexical cast to work with an iterator range 2016-03-11 17:49:32 +01:00
LianaHus
58e07151e3 - inline and assembly keywords added
- some style fixes
2016-03-11 17:49:32 +01:00
RJ Catalano
67793f1aed changed documentation and using lexical cast 2016-03-11 17:49:32 +01:00
RJ Catalano
9f5c3977fb changed extractUnsigned to handle iterators rather than a string 2016-03-11 17:49:32 +01:00
RJ Catalano
2738f4066a changed 1 to 0 in invalid argument catch block 2016-03-11 17:49:32 +01:00
RJ Catalano
93114949a3 needed this one string of notation 2016-03-11 17:49:32 +01:00
RJ Catalano
953e92b6f5 added from identifier or keyword handling of fixed types 2016-03-11 17:49:32 +01:00
RJ Catalano
29b74be413 fixed keyword added in for token type 2016-03-11 17:49:32 +01:00
chriseth
e5514becb8 BREAKING: Implement delegatecall and make default for library calls. 2016-03-11 17:49:32 +01:00
chriseth
94cbf15cfc Buildfix. 2016-02-22 18:12:58 +01:00
chriseth
968934c05d Move reusable parser components into base class. 2016-02-22 18:02:29 +01:00
RJ Catalano
9b67969fd6 further optimization, splitting function into pieces
generating strings on the fly, changed name, and added two tests
2016-02-18 11:23:00 -06:00
RJ Catalano
d2c0712f36 added const correctness to extract functions in Token
optimizations added in

more elegant solution created for m declaration

ubuntu wants to get rid of 0 <= first statement...so I will

change returnToken to token
2016-02-18 11:22:58 -06:00
RJ Catalano
84f2eb461b added two functions in Token to handle long identifiers, redid fromIdentifierOrKeyword, and made complementary changes in scanner and parser 2016-02-18 11:22:58 -06:00
RJ Catalano
f4da126018 tests added and changes made
fixed some silly problems in Token.cpp

windows error fix
2016-02-18 11:22:56 -06:00
RJ Catalano
7b918a7bc7 changes to redefine the token list, the scanner, and the parser and how they pass around variable types of different sizes
not ready for change to FixedPoint just yet

made this more const correct and added a switch statement for easier reading
2016-02-18 11:22:52 -06:00
LianaHus
5fb8953003 style fixes 2016-02-18 13:29:20 +01:00
chriseth
4a837169c5 Fix segfault when using wrong number of constructor arguments. 2016-02-11 17:12:30 +01:00
chriseth
29faf1b298 Index access for bytesXX. 2016-02-09 17:07:04 +01:00
chriseth
33b02a0d1b Fix uint178 problem. 2016-01-25 21:05:13 +01:00
Lu Guanqun
d36537e737 cond-expr: use the mobile type instead of the original type 2016-01-22 17:14:01 +00:00
Lu Guanqun
c8b0533933 [cond-expr] change the end to end test 2016-01-22 17:14:01 +00:00
Lu Guanqun
ac3019298a [cond-expr] add a test for different types 2016-01-22 17:14:01 +00:00
Lu Guanqun
1cd3288311 [cond-expr] add a test to assign memory to storage 2016-01-22 17:14:01 +00:00
Lu Guanqun
bf7daf0814 [cond-expr] don't allow conditional as left value for the first stage 2016-01-22 17:14:00 +00:00
Lu Guanqun
b003290638 [cond-expr] fixup according to code review 2016-01-22 17:14:00 +00:00
Lu Guanqun
82ee9503e9 [cond-expr] change endVisit() to visit() 2016-01-22 17:14:00 +00:00
Lu Guanqun
c781b130ef [cond-expr] make the codegen one instruction less 2016-01-22 17:14:00 +00:00
Lu Guanqun
36a758e224 [cond-expr] fix the crash in ExpressionStatement 2016-01-22 17:14:00 +00:00
Lu Guanqun
9cd96222da [cond-expr] support conditional expression as lvalue 2016-01-22 17:14:00 +00:00
Lu Guanqun
ff4f1666ab [cond-expr] generate assembly for _ ? _ : _ 2016-01-22 17:14:00 +00:00
Lu Guanqun
047172eb9a [cond-expr] add type checker 2016-01-22 17:14:00 +00:00
Lu Guanqun
7eefa838a3 [cond-expr] parse _ ? _ : _ into conditional AST node 2016-01-22 17:14:00 +00:00
Lu Guanqun
4563d4bd3c [cond-expr] add visitor related functions 2016-01-22 17:14:00 +00:00
Lu Guanqun
4fa0326813 [cond-expr] add an AST node 2016-01-22 17:14:00 +00:00
chriseth
67c855c583 Merge pull request #356 from guanqun/break-not-in-loop
check whether break/continue is in the loop
2016-01-20 19:23:23 +01:00
Lu Guanqun
cb3e07acfc remove the unused line 2016-01-19 15:00:19 +00:00
chriseth
d21c4276b3 Merge pull request #351 from chriseth/autoload
Automatically load imported files in solc.
2016-01-19 13:14:25 +01:00
Lu Guanqun
df728581ce add another test case for continue not in loop 2016-01-19 03:24:58 +00:00
Lu Guanqun
c8886ed5cf code changes according to Chris's comments 2016-01-19 02:16:13 +00:00
chriseth
0099513cd4 Merge pull request #347 from chriseth/libraryNameClashes
Detect library name clashes
2016-01-18 09:24:11 +01:00
chriseth
2c5d045729 Merge pull request #359 from LianaHus/sol_only_one_array_as_state_var
fixed ICError when creating EI for structs containing only mapping or arrays
2016-01-18 09:23:21 +01:00
Liana Husikyan
9613a94153 Update TypeChecker.cpp 2016-01-15 18:11:05 +01:00
LianaHus
b2daa5a9d8 fixed assert on EI creation for structs containing only mapping or arrays 2016-01-15 17:36:06 +01:00
Paweł Bylica
31863528a4 Remove unnecesary std::move 2016-01-15 14:04:18 +01:00
Lu Guanqun
e130bc7e7c check whether break/continue is in the loop 2016-01-15 15:12:23 +08:00
chriseth
8f7c4e0cc2 Build fix for MacOS. 2016-01-14 14:47:32 +01:00
chriseth
17199edb4f Set error flag to true. 2016-01-14 11:36:13 +01:00
chriseth
2364c55735 Detect library name clashes. 2016-01-14 11:36:13 +01:00
chriseth
d2f18c73f7 Merge pull request #346 from chriseth/importAliases
Allow aliases during import.
2016-01-13 17:29:34 +01:00
RJ Catalano
c45593a444 clarification on dynamic arrays, switcheroo on typepointer, and a documentation test added 2016-01-11 23:41:20 -06:00
chriseth
287f0a2ddf Autoload files in solc. 2016-01-12 01:05:05 +01:00
RJ Catalano
4a6815c9bd Merge branch 'develop' of https://github.com/ethereum/solidity into develop 2016-01-11 15:39:35 -06:00
RJ Catalano
ac664e7f86 final changes to typechecker, the expression compiler, and a couple more tests for good measure 2016-01-11 14:25:59 -06:00
chriseth
f20a604c5a Allow aliases during import. 2016-01-11 13:56:02 +01:00
RJ
c78b9c5737 Update ExpressionCompiler.cpp 2016-01-10 21:49:36 -06:00
RJ
72a641fe9f Update ExpressionCompiler.cpp 2016-01-10 21:37:47 -06:00
RJ
e18eaa4615 Update ExpressionCompiler.cpp 2016-01-10 01:12:17 -06:00
RJ
df9dfa8fef find common type 2016-01-10 01:09:58 -06:00
chriseth
d3c8847726 Fixed a crash during type checking. 2016-01-08 15:20:54 +01:00
chriseth
b158e48c1a Merge pull request #338 from guanqun/add_paren
support syntax "(x) = 3"
2016-01-05 13:15:29 +01:00
chriseth
e27bfa023d Merge pull request #317 from chriseth/pathsEverywhere
Use paths instead of simple identifiers wherever possible.
2016-01-04 11:47:11 +01:00
Lu Guanqun
568da11369 support decayed tuple expression as left value 2016-01-04 16:11:36 +08:00
chriseth
0e2fa39fad Use paths instead of simple identifiers wherever possible. 2015-12-21 18:44:21 +01:00
chriseth
2466fb68a0 Merge pull request #308 from chriseth/fixoverloadbug
Fix bug preventing overloads of different array types.
2015-12-21 15:37:51 +01:00
chriseth
6f78998aaf Merge pull request #309 from chriseth/fix_cross_contract_enum_access
Add structs and enums to contract types.
2015-12-21 15:37:24 +01:00
chriseth
6c6295b74e Merge pull request #311 from guanqun/correct-boolean-literal-position
correct true/false literal's source
2015-12-18 17:14:57 +01:00
chriseth
54e3637d23 Add structs and enums to contract types. 2015-12-18 16:50:14 +01:00
Lu Guanqun
e4f713b55b correct true/false literal's source
Before:
        Literal, token: true value: true
           Type: bool
           Source: "true;"

After:
        Literal, token: true value: true
           Type: bool
           Source: "true"

Extra token is removed.
2015-12-18 23:48:34 +08:00
chriseth
79c5d032fe Fix bug preventing overloads of different array types. 2015-12-18 13:56:37 +01:00
chriseth
603dc58040 Simple aliasing during import. 2015-12-18 12:46:56 +01:00
chriseth
d3c459b5a9 Parse complex import directives. 2015-12-18 12:46:54 +01:00
RJ Catalano
ed1dd50acd changed error message 2015-12-16 17:26:41 -06:00
RJ Catalano
905d55e34f updated tests and much simpler algorithm for parsing errors 2015-12-16 16:47:37 -06:00
RJ Catalano
fe04d7f7f7 added one more test and realized that there was one last change before the parser is perfect 2015-12-16 14:50:40 -06:00
RJ Catalano
de969945ea Parsing is complete 2015-12-16 13:17:41 -06:00
RJ Catalano
0ba24a5289 changed a couple of small nuances, made an attempt at fixing the parsing in the inline arrays case (fails), and added test for inline arrays per Chriseth request 2015-12-16 12:55:52 -06:00
RJ Catalano
caa6202f62 temporary assert added 2015-12-16 10:34:16 -06:00
RJ Catalano
c8e4e9c05c still not able to get types resolved, however it is compiling 2015-12-15 16:44:11 -06:00
RJ Catalano
9ab066de8c new tests 2015-12-15 14:47:09 -06:00
RJ Catalano
aebce8a1d5 now is compiling and passing soltest...but I think there may be a few more things to do 2015-12-15 12:22:52 -06:00
RJ Catalano
5a462afd03 fixed case statements 2015-12-15 11:37:00 -06:00
RJ Catalano
767103be57 changing Tuple Constructor 2015-12-15 11:16:54 -06:00
RJ Catalano
84241804dc updated attempt...still a bit more work to do but here's what's current 2015-12-15 11:00:35 -06:00
RJ Catalano
42c4339404 updated attempt, a couple of more things to sort through and change 2015-12-15 10:57:57 -06:00
chriseth
591a4f1ff4 Merge pull request #288 from chriseth/import_contexts
Do not clutter importee when importing.
2015-12-15 11:43:59 +01:00
chriseth
53da78e609 Style. 2015-12-15 09:57:05 +01:00
RJ Catalano
574e48b0b5 Inline array declarations complete 2015-12-14 17:40:35 -06:00
chriseth
251e7aa462 Merge pull request #289 from chriseth/fix_base_constructor_params
Fix: Type checker crash for wrong number of base constructor arguments.
2015-12-10 15:48:48 +01:00
chriseth
f8228e8ab1 Relative paths in import directives. 2015-12-09 19:21:02 +01:00
chriseth
7cb7818cea Source units are independent scopes. 2015-12-09 19:09:24 +01:00
chriseth
39f57a9c71 Fix: Segfaults connected to paramater types.
parameterTypes does not return by const reference anymore.
2015-12-09 17:57:34 +01:00
chriseth
f5b184323d Fix: Type checker crash for wrong number of base constructor arguments. 2015-12-09 17:37:19 +01:00
chriseth
e510e7e792 Bugfix concerning pointers to moved data. 2015-12-08 12:41:24 +01:00
chriseth
7f415da886 Code generation for calling bound methods. 2015-12-01 12:35:34 +01:00
chriseth
e853eb22fa Merge pull request #261 from chriseth/dataloc
Bugfix for explicit memory types in libraries.
2015-12-01 12:15:17 +01:00