72 Commits

Author SHA1 Message Date
Grzegorz Uriasz
c4eaf2249a Don't regenerate the AST 2020-09-09 15:33:34 +02:00
Radosław Rowicki
93341dc13b
Prepared for REPL usage (#218)
* Prepared for REPL usage

Exposed expr parsing

ets init in constant

Exposing and fixing

exposed expr

This will be squashed either

Expose letdef

Error handling

exposed autoimport

remove unnecessary changes

Fix types

Parser update

Expose body parser

remove map_get warning

make dialyzer happy

* Formatting

Co-Authored-By: Hans Svensson <hanssv@gmail.com>

Co-authored-by: Hans Svensson <hanssv@gmail.com>
2020-04-02 12:29:14 +02:00
Radosław Rowicki
4f554acee6
Fix error messages for some illegal constructions, fix absolute path includes (#251)
* Updated tests, banned type decls and toplevel letvals

* Properly ban nested contracts

* Fix including by path

* Fix error message test

* Fix prettpr attr display. Make dialyzer happy

* More tests

* Fixed type printing

* Updated docs
2020-03-30 14:52:16 +02:00
Ulf Norell
4d4a14a9ab
GH-196 pattern matching lhs (#210)
* Allow block with separate type signature and definition of a function

For instance,
```
function
  add : (int, int) => int
  add(x, y) = x + y
```

cc #196

* Allow pattern matching in left-hand sides

* Changelog

* Fix type spec

* partial case-on-constructor

* Changelog for pattern-matching lets
2020-01-15 09:41:03 +01:00
Ulf Norell
f42353b300 Handle encoding/decoding bits
Fixes GH-174
2019-11-18 12:16:04 +01:00
Ulf Norell
878140e03c Add function to validate byte code against source code 2019-11-15 14:22:44 +01:00
Ulf Norell
dd94a6bd67 add pragma to check compiler version 2019-09-27 17:31:10 +02:00
Hans Svensson
26a5a3b8ad implement option pp_assembler for FATE 2019-09-10 11:31:09 +02:00
Ulf Norell
9dac134477 Print the error kind in error messages 2019-09-06 09:51:17 +02:00
Hans Svensson
f07d1904ba Less redundant error message 2019-09-05 15:28:03 +02:00
Hans Svensson
47b3b9bcca Correct error type + new aebytecode 2019-09-05 15:14:17 +02:00
Hans Svensson
5a1acd9d18 Make aeso_compiler errors structured as well 2019-09-05 14:20:40 +02:00
Hans Svensson
37a37a169d File not found error 2019-09-05 11:16:31 +02:00
Ulf Norell
510935d945 Framework and tests for code generation (icode/fcode) errors 2019-09-03 14:35:13 +02:00
Hans Svensson
249b61238e Structured parse_errors and type_errors 2019-09-03 14:35:13 +02:00
Ulf Norell
470970d937 Disallow calling init from inside the contract 2019-09-03 12:22:15 +02:00
Ulf Norell
850221aaf3 Remove no_implicit_stdlib option 2019-08-27 14:10:40 +02:00
Ulf Norell
02af75aa34 Move stdlib code to priv dir and don't do any implicit includes 2019-08-27 11:33:29 +02:00
Hans Svensson
2620aa64b4 Add some no_implicit_stdlib for now 2019-08-22 15:21:41 +02:00
Hans Svensson
f27d37d624 Add payable modifier for contracts and entrypoints 2019-08-19 08:57:31 +02:00
Tino Breddin
dd26649f7d [PT-167805291] Add opcode for ecrecover (#122)
* Add opcode for ecrecover

* Update aebytecode

* Extend signature bytes type used for ecrecover

* Add ecrecover to changelog

* Add some type specs

* Please dialyzer
2019-08-14 21:02:46 +02:00
Radosław Rowicki
b669d2df1e Added list comprehensions and standard List, Option, Func, Pair, and Triple library (#105)
* Added standard List library and list comprehensions

Added List library.

Flatmaps WIP

Fixed dependency in flat_map

fcode generation

Updated tests to use custom list lib

Added comprehension test

Added stdlib

sanity

Test

* Extended stdlib for lists. Added error message for redefinition of stdlibx

* Fixed type template

* Improved stdlib

* More functions

* Fixed cyclic includes

* Refixed imports and added few tests

* Added fail test

* Undelete removed type spec

* Remove typo

* Fix iter function

* Fixed typo

* Added if guards and let statements in list comp

* Added more fail tests

* Option stliv

* 2 and 3 tuple stdlib

* Updated stdlib to new syntax. Added recursor and changed all/any functions

* Fixed performance issues. Changed include management

* Fixed hash type
2019-08-14 13:53:58 +02:00
Thomas Arts
cecc977898 Compiler returns abi_version 2019-08-06 13:11:31 +02:00
Hans Svensson
d526e55c26 to_sophia_value should also use no_code option 2019-08-05 15:19:22 +02:00
Hans Svensson
3663b4e5d0 Add no_code option to aeso_compile (for encode/decode calldata) 2019-08-05 14:33:53 +02:00
Tobias Lindahl
c4660fe0cf Properly decode revert strings for fate as well 2019-07-09 16:24:56 +02:00
Ulf Norell
dc5fd74934 Fix include path not being added if giving explicit options 2019-06-28 10:28:16 +02:00
Ulf Norell
79137e058e Revamp private/public functions
Problem: having public as the default makes it very easy to accidentally
export local function by forgetting the `private` modifier.

Solution: functions are private by default and must be declared as `entrypoint`s
to be exported. So `entrypoint foo() = ...` instead of `function foo() = ...`.

We still accept the `private` modifier although it is redundant.
2019-06-28 09:36:07 +02:00
Hans Svensson
502a4e6464 Fix to_sophia_value for FATE backend 2019-06-27 10:42:31 +02:00
Thomas Arts
389e931674 Unit type instead of bool 2019-06-20 13:13:28 +02:00
Thomas Arts
d571993405 Fix type spec 2019-06-20 13:13:25 +02:00
Thomas Arts
66528c8a6a Move translate_vm to aeso_vm_decode 2019-06-20 13:10:08 +02:00
Thomas Arts
46c746da1c Refactor string_to_code 2019-06-20 13:10:08 +02:00
Thomas Arts
1c346af85e whitespaces 2019-06-20 13:10:08 +02:00
Thomas Arts
a34558412d Arguments are in the body of the call, use term_to_fate before serializing them 2019-06-14 12:41:21 +02:00
Thomas Arts
95c41b8eee Avoid hash collisions in calldata creation 2019-06-14 12:41:21 +02:00
Thomas Arts
46963a8326 Update aeso_compiler 2019-06-11 15:25:01 +02:00
Hans Svensson
3e2281a834 Make fate-backend also return a Map 2019-06-10 15:13:34 +02:00
Hans Svensson
bb4ef61a50 Allow negative literals in calldata and result 2019-06-03 09:08:53 +02:00
Hans Svensson
758fecbb9b
Merge pull request #75 from aeternity/fix_aci
Restructure and improve ACI
2019-05-31 11:33:07 +02:00
Ulf Norell
bea524635b Add backend argument (aevm | fate) to aeso_compiler options
and test fate backend on (most) compilable contracts
2019-05-28 16:40:54 +02:00
Hans Svensson
c60999edf0 Refactor aeso_aci with dont_unfold, etc. 2019-05-28 11:08:36 +02:00
Ulf Norell
389072fb12 Add stateful to __call 2019-05-14 09:32:52 +02:00
Hans Svensson
3255c62e0e Revert bytes(N) from icode/vm-types 2019-04-23 17:47:50 +02:00
Hans Svensson
4324bfd49e Add bytes(int), add address_literalsm add ecverify_secp25k1
hash -> bytes(32)
signature -> bytes(64)
address literals
2019-04-23 10:40:02 +02:00
Robert Virding
9f5f8d4444 Change function references from aeso_sophia to aeb_aevm_data 2019-04-02 16:00:10 +02:00
Robert Virding
0d8b7c7c79 First commit fixinng references from aeso_ to aeb_
Also remove local copies of modules moved to aebytecode.
2019-04-02 15:59:12 +02:00
Hans Svensson
a089af555f More better type specs 2019-03-13 19:57:27 +01:00
Hans Svensson
cd116b23d7 add aeso_compiler:decode_calldata/3 2019-03-13 16:15:48 +01:00
Hans Svensson
f266c5eed8 Add a VERSION file at the top level and go from there 2019-03-04 12:17:54 +01:00