Commit Graph

500 Commits

Author SHA1 Message Date
d0cd
5bf16064ab WIP Impl codegen for tuples 2022-11-08 15:49:47 -08:00
d0cd
2287e86b56 WIP flattening 2022-11-08 15:49:47 -08:00
d0cd
910d373afd WIP support tuples on lhs of definitions 2022-11-08 15:49:47 -08:00
d0cd
40ff47882f Add support for expression statements in compiler passes 2022-11-08 15:49:47 -08:00
d0cd
af08c4f2e5 Some cleanup 2022-11-08 15:49:47 -08:00
d0cd
678f8b02a1 Fix unit expression 2022-11-08 15:49:47 -08:00
d0cd
6789bc8aae Add unit expressions to the AST 2022-11-08 15:49:47 -08:00
d0cd
3ab83f45f3 Fix bug, regen tests 2022-11-08 15:49:47 -08:00
d0cd
134fc1860c Remove debug prints 2022-11-08 15:49:47 -08:00
d0cd
b60cd7e4b0 Remove redundant check 2022-11-08 15:49:47 -08:00
d0cd
c07e07d9d1 Fix tuple flattening 2022-11-08 15:49:47 -08:00
d0cd
c651da0581 wip tuples 2022-11-08 15:49:47 -08:00
d0cd
4963a11ee7 More tyc restricting nested tuples 2022-11-08 15:49:47 -08:00
d0cd
2839de13c6 Forbid tuples in input and output types 2022-11-08 15:49:47 -08:00
d0cd
29369b2a42 Better tyc for tuples in composite data types 2022-11-08 15:49:47 -08:00
d0cd
fdddb8054a Remove flattening circuits and nested tuples 2022-11-08 15:49:47 -08:00
Pranav Gaddamadugu
6ae2d9727b Cleanup 2022-11-08 15:49:47 -08:00
Pranav Gaddamadugu
605f675ff6 More tyc 2022-11-08 15:49:47 -08:00
Pranav Gaddamadugu
6d82f83c37 WIP 2022-11-08 15:49:46 -08:00
Pranav Gaddamadugu
b622d35d8f Implement logic for flattening circuit definitions 2022-11-08 15:49:46 -08:00
Pranav Gaddamadugu
9994a0451f wip: basic tyc for empty and singleton tuples 2022-11-08 15:49:46 -08:00
d0cd
a05b7e6b70 Codegen uses struct instead of interface 2022-11-05 18:18:48 -07:00
collin
e6c3700945 merge testnet3 2022-11-04 12:46:32 -07:00
Collin Chin
d329181999
Merge pull request #2151 from AleoHQ/fix/span-for-function-call-tyc
Better error messages for mistyped function calls.
2022-11-04 12:34:08 -07:00
Collin Chin
1c7fefac53
Merge pull request #2150 from AleoHQ/fix/tyc-for-member-access
Fix type checking for member access.
2022-11-04 12:33:37 -07:00
Pranav Gaddamadugu
7e70da2326 Implement check for nested import 2022-10-31 18:05:46 -07:00
d0cd
43919a9644 Disable string type in type checker 2022-10-31 18:01:04 -07:00
d0cd
3c2da076ff
Merge pull request #2144 from AleoHQ/fix/conditional-assert
Fixes flattening for `console` statements.
2022-10-31 17:11:43 -07:00
d0cd
c4279e2a83
Merge pull request #2146 from AleoHQ/fix/tyc-for-loop-bounds
Fix/tyc for loop bounds
2022-10-31 17:11:19 -07:00
d0cd
0b7d5c4892 Implement fix 2022-10-31 13:53:40 -07:00
d0cd
b32bfba376 Fmt; clippy 2022-10-31 13:16:32 -07:00
d0cd
76d302dbad Implement fix; fix span produced by parser 2022-10-31 13:14:15 -07:00
d0cd
9907d89886 Implement fix 2022-10-27 20:21:18 -07:00
d0cd
462d3105a0 Update doc 2022-10-25 18:29:27 -07:00
d0cd
9c44c38dc2 Fix logical formula 2022-10-25 16:21:57 -07:00
d0cd
fe28cabb72 Impl flattening for console statements 2022-10-25 15:54:45 -07:00
d0cd
52ff7b82c5 Refactor guard construction 2022-10-25 15:21:43 -07:00
d0cd
e07887e9c7 Cleanup 2022-10-24 22:44:43 -07:00
d0cd
df01360010 Clippy 2022-10-24 22:41:10 -07:00
d0cd
28eb05f56d Implement fix 2022-10-24 22:18:05 -07:00
Haruka
aab179c676 Preserve struct member order when reordering owner and gates 2022-10-22 02:46:22 +09:00
d0cd
1f9f1750fe Clippy; add compiler check 2022-10-12 00:22:55 -05:00
d0cd
264e60c6ee Update doc 2022-10-12 00:15:06 -05:00
Pranav Gaddamadugu
047575f9bf Fix failing case 2022-10-12 00:15:06 -05:00
Pranav Gaddamadugu
8e3cd83bb8 Fix failing case 2022-10-12 00:15:06 -05:00
Pranav Gaddamadugu
028a01efde More fixes 2022-10-05 23:51:56 -07:00
Pranav Gaddamadugu
e15e8f05d6 Additional validation for program scope and imported files 2022-10-05 14:59:06 -07:00
Pranav Gaddamadugu
8f2a6fdb27 Support AST changes in compile passes 2022-10-05 10:38:35 -07:00
Pranav Gaddamadugu
c0c5e58011 Add checks for function calls 2022-10-03 16:18:58 -07:00
Pranav Gaddamadugu
e7e01b23a9 Clean up code gen 2022-10-03 10:45:26 -07:00
Pranav Gaddamadugu
fef22d6d5a Clean up tyc pass 2022-10-03 10:40:59 -07:00
Pranav Gaddamadugu
80d8880292 Parser support for transition keyword 2022-10-03 08:53:44 -07:00
Pranav Gaddamadugu
eb8366badc Some cleanup 2022-09-30 12:19:40 -07:00
Pranav Gaddamadugu
c551179b42 Fmt 2022-09-30 11:55:42 -07:00
Pranav Gaddamadugu
f51a36aeaf Rename in compiler 2022-09-30 11:52:06 -07:00
dependabot[bot]
35c7f37ded
Bump itertools from 0.10.4 to 0.10.5
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/rust-itertools/itertools/releases)
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/commits)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-21 10:19:41 +00:00
collin
bdaf486604 fix bug and regen tests 2022-09-20 22:05:49 -07:00
Pranav Gaddamadugu
f7b5e213e6 Battleship example compiles 2022-09-20 21:45:16 -07:00
Pranav Gaddamadugu
8f5e779a6a Compiler builds 2022-09-20 20:29:59 -07:00
collin
48530523d9 wip need to finish external inputs 2022-09-20 18:26:22 -07:00
collin
368d4c530c push code to parse returning external records + battleship example 2022-09-20 17:17:43 -07:00
collin
0a86a05d20 push code to parse external calls 2022-09-20 13:58:52 -07:00
Collin Chin
bbd41f81b6
Merge pull request #2073 from AleoHQ/fix/core-function-composite-data-types
Enable core function calls on composite data types.
2022-09-20 00:14:22 +02:00
Collin Chin
2cb3f570c9
Merge pull request #2072 from AleoHQ/fix/tic-tac-toe
Fix tictactoe example.
2022-09-20 00:14:11 +02:00
Pranav Gaddamadugu
792867406b Allow records and circuits for core functions 2022-09-18 02:32:35 +02:00
Pranav Gaddamadugu
8aa968ab1d Note 2022-09-17 19:22:24 +02:00
Pranav Gaddamadugu
611e65554d Cleanup 2022-09-17 19:17:01 +02:00
Pranav Gaddamadugu
7a29c76805 Regen expectations 2022-09-17 19:02:25 +02:00
Pranav Gaddamadugu
c202878013 Fix for nested flattening 2022-09-17 18:58:40 +02:00
collin
4e05840bf5 bump ci rust version to 1.63 2022-09-16 18:19:20 +02:00
collin
834ea300aa bump ci rust version to 1.65 2022-09-16 18:17:10 +02:00
collin
6c18565700 too new of rust version for actions 2022-09-16 17:51:15 +02:00
collin
62659507c5 clippy 2022-09-16 17:48:26 +02:00
collin
2e24f82f21 Update rust versions 2022-09-16 17:32:20 +02:00
collin
c1d21e699c merge testnet3 2022-09-13 15:39:20 +02:00
Pranav Gaddamadugu
a6fe8bf80c Update docs 2022-09-13 11:10:22 +02:00
Pranav Gaddamadugu
c2bed2bb54 Add name to finalize block 2022-09-13 11:06:24 +02:00
Pranav Gaddamadugu
6d35560528 More tests 2022-09-07 23:09:11 -07:00
Pranav Gaddamadugu
48ce885860 Add more tyc checks 2022-09-07 10:39:00 -07:00
Pranav Gaddamadugu
9032df19cb Parser tests for mapping 2022-09-06 12:36:27 -07:00
Pranav Gaddamadugu
bb705da769 Improve documentation for SSA and flattening 2022-09-06 12:14:37 -07:00
Pranav Gaddamadugu
267fc99978 Add new tests; regen expectations 2022-09-06 12:14:37 -07:00
Pranav Gaddamadugu
3d5ddb9e1a Clippy 2022-09-06 12:14:37 -07:00
Pranav Gaddamadugu
618117be89 Fix visibilities in codegen 2022-09-06 12:14:37 -07:00
Pranav Gaddamadugu
0fa8082656 Update token example 2022-09-06 12:14:36 -07:00
Pranav Gaddamadugu
0e1768ac59 Hook flattening pass into compiler; regen expectations 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
9d5aa9d08d Implement flattening phase 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
f74bfb034c wip flattening phase 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
18274bf4f9 More tyc 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
f4f77cdf55 Enable modes for return types in parser and AST 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
5d6c402c04 Fix buggy case 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
4266ba28c1 more wip 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
9f56b34677 wip 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
3efb4c5108 More tyc and ssa for finalize 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
791463c82f WIP tyc for finalize 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
044e41d80e Add new statements to passes 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
5521e7f30b Add finalize block to AST 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
75307d1d4e More tests 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
195fc4da31 Implement codegen for mappings 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
8a8e198f59 Tyc for mappings 2022-09-06 12:13:32 -07:00
Pranav Gaddamadugu
09e9aeb537 Add support for mappings in the parsers 2022-09-06 12:13:32 -07:00
collin
d0a2b8c3ce cargo clippy 2022-09-06 15:00:42 +02:00
Pranav Gaddamadugu
6e238eee42 Add check for type equality 2022-08-24 09:09:41 -07:00
Pranav Gaddamadugu
78604f61da Fix missed tyc in mul expressions 2022-08-23 19:40:01 -07:00
Pranav Gaddamadugu
d4470fc3bf Fix newline 2022-08-23 09:54:45 -07:00
mx
a539be5231 fix: Missing line break 2022-08-23 18:11:12 +08:00
d0cd
4c0aed8718
Merge pull request #2020 from AleoHQ/feat/ssa-simplify-expressions
[Improvement] SSA simplifies expressions in assignment statements
2022-08-18 16:29:04 -07:00
Pranav Gaddamadugu
eb4ee1428c Cleanup out dated docs 2022-08-18 15:45:30 -07:00
Pranav Gaddamadugu
0936771fb4 Fmt 2022-08-18 11:20:36 -07:00
Pranav Gaddamadugu
8af67e5242 Fix early record return in SSA 2022-08-18 11:15:27 -07:00
Pranav Gaddamadugu
934df150e3 Fmt 2022-08-18 09:22:20 -07:00
Pranav Gaddamadugu
094c54a20d Fix SSA for console statements 2022-08-18 09:17:09 -07:00
Pranav Gaddamadugu
a39ab9f77f Cleanup 2022-08-17 17:03:30 -07:00
Pranav Gaddamadugu
a2795baed8 Fmt & clippy 2022-08-17 17:03:30 -07:00
Pranav Gaddamadugu
5b732a33be Regen tests 2022-08-17 17:03:30 -07:00
Pranav Gaddamadugu
8c8aacfbd8 Cleanup 2022-08-17 17:01:29 -07:00
Pranav Gaddamadugu
f109241ee4 Redesign SSA pass to use Consumer trait 2022-08-17 17:01:29 -07:00
Pranav Gaddamadugu
4095173e7c Cleanup 2022-08-17 15:48:54 -07:00
Pranav Gaddamadugu
615cc61e9e Add console.assert 2022-08-17 15:27:11 -07:00
Pranav Gaddamadugu
1d55322276 Update parser and typechecker 2022-08-17 14:42:42 -07:00
collin
fbf0a0aea9 merge testnet3 2022-08-15 21:45:25 -07:00
Collin Chin
4d18031228
Merge pull request #2014 from AleoHQ/fix/error-on-unrecognized-type
Check for Unrecognized Type
2022-08-15 15:16:23 -07:00
Pranav Gaddamadugu
f6ba7067e1 Fix tyc for member records 2022-08-11 08:55:28 -07:00
Pranav Gaddamadugu
67f9890653 Address feedback 2022-08-11 07:50:10 -07:00
Pranav Gaddamadugu
8caafb78d5 Fmt 2022-08-11 00:55:46 -07:00
Pranav Gaddamadugu
da7ff48b11 Add check for nested records; fix codegen for circuit nested in record 2022-08-11 00:53:01 -07:00
Pranav Gaddamadugu
974e93cadf Tyc checks that types are defined 2022-08-11 00:37:04 -07:00
Pranav Gaddamadugu
dcbdb1bd85 Reintroduce IntegerType 2022-08-09 19:53:17 -07:00
Pranav Gaddamadugu
7d2f306f15 Simplify type checking logic 2022-08-09 19:53:17 -07:00
Pranav Gaddamadugu
84369793ac Update passes to account for change in AST 2022-08-06 07:49:36 -07:00
Pranav Gaddamadugu
a47eb32eaf Cleanup; add test 2022-08-05 14:58:29 -07:00
collin
d397c750d2 merge testnet3 2022-08-05 13:59:08 -07:00
Collin Chin
46f21c68a2
Merge pull request #1994 from AleoHQ/remove-unsafe
Remove all uses of unsafe
2022-08-05 13:50:53 -07:00
Pranav Gaddamadugu
d56bd3084d Fix order of folded ternary expressions when handling early return statements 2022-08-05 08:30:50 -07:00
Pranav Gaddamadugu
1e4f2b1cca Add compiler test for function calls; fix bugs; regen test expectations 2022-08-04 21:21:56 -07:00
Pranav Gaddamadugu
34be1fc39d Codegen for function call; emits closures before functions 2022-08-04 21:03:42 -07:00
Pranav Gaddamadugu
4e9b382c55 Typecheck helper functions; add codegen support 2022-08-04 19:34:46 -07:00
Pranav Gaddamadugu
fa8d03cbd6 Validate annotations; refactor FunctionInput in passes 2022-08-04 17:59:03 -07:00
Pranav Gaddamadugu
2b3bda7da7 Add Annotation to AST; enable parser support 2022-08-04 17:55:26 -07:00
Mazdak Farrokhzad
a77d3b4092 forbid unsafe_code in all crates 2022-08-05 00:36:41 +02:00
Pranav Gaddamadugu
b97cafbbfc Add support for Rem, RemWrapped, and Mod to passes 2022-08-03 12:55:24 -07:00
Pranav Gaddamadugu
c364c581ec Documentation 2022-08-03 00:03:53 -07:00
Pranav Gaddamadugu
5be72596db Implement bug fix 2022-08-02 23:50:08 -07:00
collin
60e4279934 merge testnet3 2022-07-29 14:16:34 -07:00
Pranav Gaddamadugu
bf1421280e Fix bug in SSA; regen test expectations 2022-07-29 12:52:18 -07:00
collin
0a34115ef7 stabilize scalar tests 2022-07-28 16:46:30 -07:00
collin
8a0e9bc5cc merge testnet3 regen tests 2022-07-28 14:19:57 -07:00
Pranav Gaddamadugu
3dc234325c Address feedback 2022-07-28 11:51:16 -07:00
Pranav Gaddamadugu
d11ed35c77 Addressing feedback 2022-07-28 09:24:33 -07:00
Mazdak Farrokhzad
37f51014c9 minor cleanup 2022-07-27 21:48:10 +02:00
collin
6724d2abe9 remove unused code 1 2022-07-25 14:17:36 -07:00
Pranav Gaddamadugu
9dd45c3620 Type checking errors on multiple returns 2022-07-24 21:32:36 -07:00
Pranav Gaddamadugu
65e13a77c0 SSA folds all ReturnStatements into a single statement at the end of the block 2022-07-23 10:29:14 -07:00
Pranav Gaddamadugu
ff816c59d3 Cleanup 2022-07-23 10:29:14 -07:00
Pranav Gaddamadugu
e3a36089e0 Fmt 2022-07-23 10:29:14 -07:00
Pranav Gaddamadugu
7059fb5ffa Cleanup 2022-07-23 10:29:14 -07:00
Pranav Gaddamadugu
a4a912f677 Bug fix for SSA pass 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
3d63b5c400 Cleanup 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
e82c372eac Support code gen for assign statements 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
1a62a2ba8c SSA shouldn't reconstruct function ids 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
12e356c030 Integrate SSA pass with compiler 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
cb32f82352 Pull passes/src/static_single_assignemnt from feat/ssa-and-dce 2022-07-23 10:29:13 -07:00
Pranav Gaddamadugu
3e780dd42b Fix bug in codegen for CircuitExpression 2022-07-20 12:59:23 -07:00
collin
07a199537d clippy 2022-07-18 15:47:30 -07:00
collin
66b0fcc885 merge testnet3 regen tests 2022-07-18 15:33:40 -07:00
collin
4dc0df0084 merge testnet3 2022-07-18 14:13:31 -07:00
collin
5316d900f4 merge testnet3, regen tests 2022-07-18 12:32:15 -07:00
Pranav Gaddamadugu
8199a1e9d3 More feedback/cleanup 2022-07-18 11:54:33 -07:00
Pranav Gaddamadugu
1b872576b2 Merge branch 'testnet3' into feat/loop-unrolling 2022-07-18 07:54:48 -07:00
collin
7f14e02055 import codegen working 2022-07-15 23:36:36 -07:00
collin
0368b8bd51 clippy 2022-07-15 21:00:16 -07:00
collin
914a9c385e code gen for imports 2022-07-15 20:59:47 -07:00
collin
8dde478664 fix leo new 2022-07-15 15:35:19 -07:00
collin
e82631103d clippy 2022-07-15 15:09:01 -07:00
collin
a35606f628 update revs and examples 2022-07-15 15:08:22 -07:00
Pranav Gaddamadugu
604b8cf992 Suppress dead_code warnings; these functions are used in constant folding 2022-07-15 08:55:58 -07:00
Pranav Gaddamadugu
110c3eb35c Address more feedback 2022-07-15 01:50:14 -07:00
Pranav Gaddamadugu
86b5c9faa1 Fix errors from merge 2022-07-14 17:52:36 -07:00
Pranav Gaddamadugu
b6224d6d89 Merge branch 'testnet3' into feat/loop-unrolling 2022-07-14 17:51:34 -07:00
Pranav Gaddamadugu
43a68fda86 Loop Unrolling skips instead of failing on non-const bounds 2022-07-14 17:07:37 -07:00
Pranav Gaddamadugu
fdc2f65623 More feedback 2022-07-14 17:02:37 -07:00
Pranav Gaddamadugu
923d5924fe Feedback from code review 2022-07-14 14:26:13 -07:00
collin
230491f1b1 clippy 2022-07-13 21:18:09 -07:00
Mazdak Farrokhzad
ce7ac0b443 run cargo clippy 2022-07-14 06:07:07 +02:00
Mazdak Farrokhzad
dab6629ac0 1. move tuple logic to typeck, 2. disallow multi vars in var decls 2022-07-14 06:07:05 +02:00
collin
f4a59c5745 cargo fmt 2022-07-13 21:05:38 -07:00
collin
7d604748bd add token transfer example, fix record cast codegen 2022-07-13 21:02:33 -07:00
collin
13b9261063 bump revs, fix cast instruction 2022-07-13 14:13:30 -07:00
collin
d151401385 indexmap over hashmap 2022-07-12 22:52:56 -07:00
collin
3d9c8dd0e4 add more examples, fix circuits as input 2022-07-12 21:43:19 -07:00
collin
c0e968206b fix examples 2022-07-12 18:30:55 -07:00
collin
266fdd7a5e fix readmes and licenses 2022-07-12 16:46:42 -07:00
collin
0b81f03f3a move /leo/errors -> /errors 2022-07-12 16:41:42 -07:00
collin
6d731891d0 move /leo/span -> /compiler/span 2022-07-12 16:37:10 -07:00
collin
a9992bc6d4 remove unused code 2022-07-12 16:19:58 -07:00
Pranav Gaddamadugu
f5eea6b307 Regen expectations; cleanup 2022-07-11 23:07:11 -07:00
Pranav Gaddamadugu
bceccea80b Merge branch 'testnet3' into feat/loop-unrolling 2022-07-11 22:55:42 -07:00
Pranav Gaddamadugu
639a719e4d WIP loop unrolling 2022-07-11 21:46:34 -07:00
Pranav Gaddamadugu
1a9941022c Rename type_checker to type_checking 2022-07-11 21:46:15 -07:00
collin
e013b88811 stabilize leo build 2022-07-11 21:09:27 -07:00