797 Commits

Author SHA1 Message Date
Gaith Hallak
2d17ce3ee2 Add test for unknown tvar constraints 2022-06-14 18:29:27 +04:00
Gaith Hallak
fc08fe09a5 Add tests for calling constrained functions 2022-06-14 18:29:27 +04:00
Gaith Hallak
6c17e57a7c Fix dialyzer warnings 2022-06-14 18:29:27 +04:00
Gaith Hallak
69713036d0 Add constraints to typechecker, fix old tests, add new ones 2022-06-14 18:29:26 +04:00
Gaith Hallak
f56eeb0b2b Use id() for constraints instead of keywords 2022-06-14 18:26:22 +04:00
Gaith Hallak
3f177d363f Add constraints to the syntax and parser 2022-06-14 18:25:21 +04:00
Gaith Hallak
b599d581ee
Fix warnings reporting and stdlib warnings (#367)
* Fix stdlib warnings

* Mark unused includes when used from non-included files

* Do not mark indirectly included files as unused

* Show unused include warning only for files that are never used

* Remove unused include from Option.aes

* Consider functions passed as args as used

* Return warnings as a sorted list

* Fix failing tests

* Fix dialyzer warning

* Fix warning in Func.aes
2022-06-14 12:22:32 +04:00
Gaith Hallak
b3767071a8
Allow binary operators to be used as lambdas (#385)
* Add operator lambdas

* Do not register anonymous functions as called functions

* Add tests

* Update CHANGELOG

* Update the docs

* Do not allow (..) to be used as a lambda

* Rename the function sum to any
2022-06-03 13:12:23 +04:00
Gaith Hallak
b0e6418161
Ban empty record definitions (#384)
* Ban empty record declarations

* Use definition instead of declaration

* Fix the failing test
2022-05-25 17:59:46 +04:00
Gaith Hallak
a894876f56
Show the file name in the location if the file is included (#383) 2022-05-10 18:27:06 +04:00
Radosław Rowicki
0af45dfd19
Deprecate AEVM (#375)
* Deprecate AEVM

* Fix test, changelog

* Restore old rebar

* rebar lock fix

* undo export

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>

* undo export

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>

* Solve GH suggestions

* Fix the docs

* update docs

* Remove unused tests

* undo weird change

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>
2022-05-10 15:33:59 +02:00
Gaith Hallak
c5bfcd3bdc
Add MCL_BLS12_381 types to from_fate_builtin (#382)
* Add MCL_BLS12_381 types to from_fate_builtin

* Add tests for mcl_bls12_381 types to sophia value
2022-05-05 13:19:43 +04:00
Dincho Todorov
85879f5380
Fix BLS12_381.fp and BLS12_381.fr size in the docs (#377) 2022-04-27 17:10:56 +03:00
Dincho Todorov
8897cc6cbd
Fix bls12_381 anchor in the stdlib docs (#376) 2022-04-26 20:10:11 +03:00
Marco Walz
0ec7fdc6ac
Merge pull request #368 from aeternity/docs/improve-stdlib-structure
docs: order namespaces alphabetically and place Set in includables
2022-04-12 12:49:40 +02:00
Gaith Hallak
74aff5401b
Introduce pipe operator |> (#371)
* Add pipe operator

* Add tests

* Update docs and CHANGELOG
2022-04-12 12:40:32 +03:00
Marco Walz
cfcf0a8a81
Merge pull request #372 from aeternity/pygments-version
chore(deps): bump pygments version
2022-03-28 12:09:20 +02:00
marc0olo
ca31db7cad chore(deps): bump mkdocs version from 1.2.3 to 1.2.4 2022-03-28 10:43:37 +02:00
marc0olo
196460a607 chore(deps): bump pygments version 2022-03-22 13:19:11 +01:00
marc0olo
bf04362f9a docs: order namespaces alphabetically and place Set in includables 2022-02-04 12:41:08 +01:00
Hans Svensson
d4ea7d5d3b
Clarify signature format for ecverify/ecrecover (#365) 2022-01-11 14:02:40 +01:00
Hans Svensson
c1c3c29393
Add oneline error pretty-printing (#364) 2022-01-11 14:02:05 +01:00
Gaith Hallak
b474bb22cd
Implement caching for compiled child contracts (#363) 2022-01-11 16:50:59 +04:00
Hans Svensson
c04f66a00a Merge pull request #362 from aeternity/ghallak/354
Simplify error messages reported by the compiler
2022-01-11 11:48:11 +04:00
Gaith Hallak
37d86ad45b Simplify error messages reported by the compiler
Add raw error message for 2 errors

The errors: `unnamed_map_update_with_default` and `unbound_variable`.

Revert "Add raw error message for 2 errors"

This reverts commit 0db6d16140d52e29cd8a12d8719ee57ca874d5f5.

Remove trailing new lines and at POS from error messages

Convert multiple line error messages into single line error messages

Remove at POS from pp_why_record context

Change error message with new line before code

Fix tests for changed error messages

Fix the rest of the error messages

Add new line after error message

Remove new line from the end of data error messages
2022-01-11 11:48:08 +04:00
Gaith Hallak
60f3a484e6
Solve constraints together and in the order they are added (#360)
* Solve named argument constraints when record type dereferencing fails

* Revert "Solve named argument constraints when record type dereferencing fails"

This reverts commit ca38a171a9eefdddbc3f6a41f8a268c42662cd7a.

* Solve constraints together and in order

* Fix dialyzer warnings

* Add comment on solve_known_record_types

* Remove unused function
2021-12-16 13:54:06 +02:00
Hans Svensson
40c78c1707
Merge pull request #361 from aeternity/clarify_protected_calls
Clarify documentation on protected calls
2021-12-10 14:52:11 +01:00
Hans Svensson
cf08aeee04 Clarify documentation on protected calls 2021-12-10 14:46:44 +01:00
Marco Walz
a04dd6c86d
Merge pull request #359 from marc0olo/feature/syntax-highlighting
feat: activate Sophia syntax highlighting by using specific pygments …
2021-12-03 17:26:14 +01:00
marc0olo
f488b35f2e chore: make sure python libs are updated on install 2021-12-01 10:06:07 +01:00
marc0olo
cc1de9baba feat: activate Sophia syntax highlighting by using specific pygments version 2021-12-01 08:37:49 +01:00
Gaith Hallak
fe5f5545d3
Add compiler warnings (#346)
* Add compiler warnings

Add include_type annotation to position

Add warning for unused includes

Add warning for unused stateful annotation

Add warning for unused functions

Add warning for shadowed variables

Add division by zero warning

Add warning for negative spends

Add warning for unused variables

Add warning for unused parameters

Change the ets table type to set for unused vars

Add warning for unused type defs

Move unused variables warning to the top level

Temporarily disable unused functions warnings

Add all kinds of warnings to a single ets table

Enable warnings separately through options

Use when_option instead of enabled_warnings

Turn warnings into type errors with warn_error option

Enable warning package warn_all

Re-enable unused functions warnings

Report warnings as type errors in a separate function

Make unused_function a recognized warning

Report warnings as a result of compilation

Fix tests and error for unknown warnings options

Fix dialyzer warnings

Do not show warning for variables called "_"

Move warnings handling into a separate module

Do not show warning for unused public functions in namespaces

Add src file name to unused include warning

Mark public functions in namespaces as used

Add tests for added warnings

Add warning for unused return value

Add test for turning warnings into type errors

* Update CHANGELOG
2021-11-24 11:46:21 +02:00
Dincho Todorov
98a4049f03
Use OTP 21 for builds (#332) 2021-11-11 23:08:31 +02:00
seanhinde
3dce0e627b
Merge pull request #353 from aeternity/otp-24-deps
Update aebytecode dep for otp-24
2021-11-11 10:51:40 +01:00
Sean Hinde
6b46fc268b Use older rebar3 for upgrade 2021-11-10 14:32:29 +01:00
Sean Hinde
30bedad164 Use older rebar3 for upgrade 2021-11-10 14:25:33 +01:00
Sean Hinde
4d6938c741 Update aebytecode dep for otp-24 2021-11-10 14:21:23 +01:00
Hans Svensson
10fc88a21d
Merge pull request #349 from aeternity/fix_oracle_expiry_doc
Fix docs Oracle.expire -> Oracle.expiry
2021-10-21 14:16:32 +02:00
Hans Svensson
3218a2c172 Fix docs Oracle.expire -> Oracle.expiry 2021-10-21 14:08:03 +02:00
Gaith Hallak
5ad5270e38
Bump version to 6.1.0 and fix CHANGELOG (#348) v6.1.0 2021-10-20 12:42:48 +03:00
Gaith Hallak
a982f25262
Pattern guards for functions and switch statements (#339)
* Add case guards to parser

* Add pattern guards to infer types and fcode generation

* Add functions guards

* Add test for patterns guards

* Update docs

* Update CHANGELOG.md

* Remove stateful context from Env for guards

* Elaborate on guards

* Add failing test for stateful pattern guards

* Implement multiple guards

* Fix tests

* Disable aevm related tests

* Split the sentence before if and otherwise

* Fix type in docs

* Implement multiple exprs in the same guard

* Fix pretty printing

* Change tests to include multiple guards

* Add test for non-boolean guards

* Desugar clauses with guards

* Fix incomplete patterns bug

* Fix docs

* Compile to icode when no guards are used

* Revert "Disable aevm related tests"

This reverts commit e828099bd97dffe11438f2e48f3a92ce3641e85b.
2021-10-20 11:04:00 +03:00
Hans Svensson
20cab3ae57
Merge pull request #347 from marc0olo/chore/update-mkdocs-version
chore: mkdocs v1.2.3
2021-10-18 10:33:10 +02:00
marc0olo
1ffb20178c chore: mkdocs v1.2.3 2021-10-15 12:03:46 +02:00
Hans Svensson
6d79d2d558
GH344 - Add builtin types in decoder (#345)
* Only use basic types in type_env

* Add builtin types to the calldata/result decoder for FATE
2021-09-30 19:11:00 +02:00
Hans Svensson
24c579a5d3
Merge pull request #342 from aeternity/fix_aci_rendering
Don't forget stateful when rendering the ACI
2021-09-24 14:21:42 +02:00
Hans Svensson
1be24c94c5 Don't forget stateful when rendering the ACI 2021-09-20 14:50:16 +02:00
Hans Svensson
ebb1f9ecf9
Merge pull request #340 from aeternity/add_bitwise_stdlib
Add Bitwise.aes to stdlib
2021-09-16 10:49:00 +02:00
Hans Svensson
9cb3158dfd Fix documentation and comments 2021-09-12 16:24:08 +02:00
Hans Svensson
becafe4001 Add Bitwise.aes to stdlib 2021-09-12 14:57:45 +02:00
Gaith Hallak
e8a171dc45
Allow assigning patterns to variables (#336)
* Change syntax tree and parser

* Add assign pattern to type inference

* Use check_expr instead of hard-coded type

* Add fcode generation for assign pattern

* Implement rename_spat for assign pattern

* Add tests

* Update CHANGELOG.md

* Update docs and changelog

* Add letpat to aeso_syntax_utils:fold

* Use Plus instead of Scoped
2021-09-11 16:18:30 +02:00