Commit Graph

413 Commits

Author SHA1 Message Date
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
Pranav Gaddamadugu
c2bed2bb54 Add name to finalize block 2022-09-13 11:06:24 +02:00
Pranav Gaddamadugu
267fc99978 Add new tests; regen expectations 2022-09-06 12:14:37 -07:00
Pranav Gaddamadugu
0fa8082656 Update token example 2022-09-06 12:14:36 -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
77effd4613 Implement parsing for finalize, increment, and decrement 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
1b6dea395f Add parser tests; regen expectations 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
Pranav Gaddamadugu
eb4ee1428c Cleanup out dated docs 2022-08-18 15:45:30 -07:00
Pranav Gaddamadugu
1d2cddbc7c Fmt 2022-08-17 16:22:13 -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
Pranav Gaddamadugu
dcbdb1bd85 Reintroduce IntegerType 2022-08-09 19:53:17 -07:00
Pranav Gaddamadugu
7ff7170c45 Fix unary negation parser; add test 2022-08-09 19:53:17 -07:00
Pranav Gaddamadugu
a1d79da501 Parser produces negative integer literals 2022-08-09 19:53:17 -07:00
Pranav Gaddamadugu
6897628800 Cleanup 2022-08-06 07:50:18 -07:00
Pranav Gaddamadugu
965102152a Parser produces simplified assignment statements directly 2022-08-06 07:49:36 -07:00
collin
d397c750d2 merge testnet3 2022-08-05 13:59:08 -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
a73ddfb815 Add parser tests for annotations 2022-08-04 17:55:26 -07:00
Pranav Gaddamadugu
2b3bda7da7 Add Annotation to AST; enable parser support 2022-08-04 17:55:26 -07:00
Pranav Gaddamadugu
a269e0f764 Add @ token to the parser 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
Collin Chin
754a3ce685
Merge pull request #1987 from AleoHQ/record-nonce
Record nonce
2022-08-04 09:56:40 -07:00
collin
a090d85f10 Update deps 2022-08-04 09:29:04 -07:00
collin
13350da303 merge testnet3 2022-08-03 17:20:40 -07:00
collin
0f731a41f0 update deps 2022-08-03 15:34:23 -07:00
collin
8fb2e60cb4 cargo fmt + clippy 2022-08-03 14:52:05 -07:00
collin
e5da76abaf impl nonce 2022-08-03 13:35:58 -07:00
Pranav Gaddamadugu
7ff84af785 Add Rem, RemWrapped, and Mod to parser 2022-08-03 12:54:57 -07:00
collin
5777c76d04 refactor more iteration tests 2022-08-01 17:01:58 -07:00
collin
2cb40cebf0 patch group coordinate codegen 2022-08-01 14:30:05 -07:00
collin
3826293f31 fix op assign bugs 2022-08-01 14:14:39 -07:00
collin
dd8e1c1a4e impl and, or, bitand, bitor, bitxor, shl, shr assign parsing 2022-07-29 12:47:23 -07:00
collin
c73671bb7b impl sub, mul, div, pow assign parsing 2022-07-29 11:57:34 -07:00
collin
d71788e8a4 impl add assign operator 2022-07-28 18:00:46 -07:00
collin
66c5deb7e3 merge testnet3 do not regen tests 2022-07-28 14:23:47 -07:00
Pranav Gaddamadugu
d11ed35c77 Addressing feedback 2022-07-28 09:24:33 -07:00
collin
184af219ee build and check aleo files during cargo test 2022-07-27 15:49:49 -07:00
dependabot[bot]
108637cd8b
Bump clap from 3.2.12 to 3.2.14
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.12 to 3.2.14.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.12...v3.2.14)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 07:47:38 +00:00
collin
66b0fcc885 merge testnet3 regen tests 2022-07-18 15:33:40 -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
Pranav Gaddamadugu
b6224d6d89 Merge branch 'testnet3' into feat/loop-unrolling 2022-07-14 17:51:34 -07:00
Pranav Gaddamadugu
923d5924fe Feedback from code review 2022-07-14 14:26:13 -07: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
3d9c8dd0e4 add more examples, fix circuits as input 2022-07-12 21:43:19 -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
fa28678a26 impl leo run 2022-07-12 14:44:20 -07:00
Pranav Gaddamadugu
bceccea80b Merge branch 'testnet3' into feat/loop-unrolling 2022-07-11 22:55:42 -07:00
collin
e013b88811 stabilize leo build 2022-07-11 21:09:27 -07:00
collin
c719843223 impl program json, aleo build and run working 2022-07-11 14:10:22 -07:00
Pranav Gaddamadugu
3b76574a78 Add start, stop values for IterationStatement 2022-07-11 11:20:54 -07:00
Pranav Gaddamadugu
641c98b69e Use refactored types in parsing and tyc 2022-07-11 07:19:00 -07:00
collin
ed79f5c957 merge return-tuple branch 2022-07-09 20:55:30 -07:00
collin
a15fce710c merge testnet3 2022-07-09 16:51:20 -07:00
collin
1bcb9accec clippy 2022-07-09 15:38:11 -07:00
collin
642ad32e99 parse tuple access 2022-07-09 14:11:18 -07:00
collin
a7fc19a69f impl tuple ast access 2022-07-09 13:22:10 -07:00
collin
9e422599a0 impl tuple parsing 2022-07-09 12:39:50 -07:00
collin
296c62a280 impl tuple type expression 2022-07-09 10:15:08 -07:00
Pranav Gaddamadugu
8ab98c9434 Refactor emitter to reduce the number of into invocations; more cleanup 2022-07-08 14:10:54 -07:00
Pranav Gaddamadugu
990b5a75da Rename LiteralExpression to Literal; more cleanup 2022-07-08 13:44:21 -07:00
collin
95c2f66c5a clippy 2022-07-06 20:49:05 -07:00
collin
dc9063de5a update snarkvm rev 2022-07-06 14:47:52 -07:00
Mazdak Farrokhzad
91fd8ff1b2
fix typo 2022-07-01 00:03:26 +02:00
Mazdak Farrokhzad
952d7f4e36 records: base them atop circuits instead 2022-06-30 15:37:18 +02:00
collin
a58edee122 cargo clippy 2022-06-27 12:50:23 -10:00
collin
6933d5d9da cargo clippy 2022-06-27 09:44:49 -10:00
collin
21c6a2167a type check record init expressions 2022-06-26 10:46:32 -10:00
collin
18a74cfb85 type check record type declaration 2022-06-24 11:47:01 -10:00
collin
d45ab61e40 parse record type declaration 2022-06-23 22:34:18 -10:00
collin
9d0fd00072 add record type 2022-06-23 21:44:06 -10:00
collin
7417496eee merge testnet3 2022-06-22 21:42:00 -10:00
collin
4400545543 add all core circuit tests 2022-06-22 21:19:26 -10:00
collin
0c89c1b5fb add circuit variable access and type check 2022-06-22 15:14:00 -10:00
collin
d6e32788b4 rename static -> associated, addresses review comments 1/2 2022-06-21 18:30:10 -07:00
Mazdak Farrokhzad
b4e8a773df simplify bidi override logic 2022-06-21 17:12:36 +02:00
Mazdak Farrokhzad
1d92e07fdf simplify tokenize_iter 2022-06-21 17:12:36 +02:00
Mazdak Farrokhzad
2c194b8e57 reduce work for string literals bidi check 2022-06-21 17:12:36 +02:00
Mazdak Farrokhzad
8b3e87889f cargo clippy 2022-06-21 17:12:36 +02:00
Mazdak Farrokhzad
7226659bf6 Value -> Literal 2022-06-21 17:12:34 +02:00
Mazdak Farrokhzad
ddbf2ae849 1. Speed up string literal lexing.
2. Move address check to parser.
3. Move assignment place WF check to type checker.
2022-06-21 17:07:44 +02:00
collin
99605f46a5 le, ge -> lte, gte 2022-06-20 13:24:20 -07:00
collin
bfd3a37a42 merge testnet3 2022-06-20 12:34:33 -07:00
collin
52395bba45 fix circuit type checking 2022-06-17 18:32:49 -07:00
collin
26810a15ae impl bhp, pedersen, poseidon instructions 2022-06-17 15:37:48 -07:00
collin
d527a88a3a impl core circuit instructions 2022-06-17 11:17:46 -07:00
gluax
c9ab4bd3d7 add bitwise op parsing, fix tests 2022-06-16 15:40:48 -07:00
gluax
b656fd5347 fix type checking on certain bitwise operations 2022-06-16 12:49:41 -07:00
gluax
2181672b60 had to fix function calls after previous changes 2022-06-16 12:03:24 -07:00
gluax
a40d025d18 clean up of parsing method call fixs 2022-06-16 11:36:50 -07:00
gluax
33fe8ebbc2 fixes bug #1877 to make debugging easier, fixes parsing of method calls 2022-06-16 11:33:16 -07:00
collin
993b86e8c7 add circuit type parsing up to type checking 2022-06-15 16:08:05 -07:00
collin
b2890f393a merge testnet3 2022-06-15 10:23:01 -07:00
Mazdak Farrokhzad
eee838abba fixes in special methods parsing 2022-06-15 14:51:44 +02:00
collin
6c759b7174 impl unary 2022-06-13 18:35:18 -07:00
gluax
2c9a91552c Merge branch 'testnet3' of github.com:AleoHQ/leo into feature/compiler-benchmarking 2022-06-12 09:26:30 -07:00
collin
02e3313d59 add docs for type checking and fix bugs 2022-06-10 17:21:33 -07:00
collin
32f0c96b6f impl shl shr tokens and type checking 2022-06-10 16:33:30 -07:00
collin
f248827b37 impl binary operators WIP no tests 2022-06-09 16:47:31 -07:00
collin
0e0ec362f1 cargo fmt 2022-06-09 13:24:01 -07:00
collin
1b4e37e66e fix symbol index bug 2022-06-09 13:16:54 -07:00
collin
a32418133c parse method calls directly 2022-06-09 13:01:59 -07:00
gluax
36440719fb resolve merge conflicts 2022-06-09 12:46:59 -07:00
gluax
540fdccffe Update abnf, and give docs over parser keywords 2022-06-09 12:45:52 -07:00
gluax
ba7aef7f1e merge conflicts fix 2022-06-09 12:35:26 -07:00
gluax
4607f2955a add some more checks and namespaces for benchmarks, docs 2022-06-09 12:23:57 -07:00
collin
5dba9cf07f impl method call type checking 2022-06-08 14:44:08 -07:00
gluax
5ce5102a37 the rest of the test-framework rework and clean up start 2022-06-08 14:06:25 -07:00
gluax
f6990e75fc fixed some bugs 2022-06-08 06:46:54 -07:00
0rphon
0af9622cd9 replaced structopt with clap 2022-06-06 11:00:08 -07:00
collin
f0a1573058 impl method call expression parsing 2022-06-03 13:27:23 -04:00
collin
d419e3b7d8 merge testnet3 2022-06-02 11:51:46 -04:00
collin
27c858a0fc merge testnet3 2022-06-02 11:33:11 -04:00
Collin Chin
59ffe66363
Merge branch 'testnet3' into issue-1841 2022-06-01 22:51:44 -04:00
gluax
9638a695aa fix more bugs, add type checking 2022-06-01 11:16:00 -07:00
collin
3b62e3cc97 fix bugs 2022-06-01 13:49:55 -04:00
Alessandro Coglio
ad43c50902 Remove remnant mentions on tendril.
Rename a function.

Rename two variables.

Update some comments.

Remove a README entry that is no longer there.
2022-05-31 22:24:17 -07:00
Mazdak Farrokhzad
6399f873f5 improve error for '&' not followed by '&' 2022-05-31 16:28:01 +02:00
Mazdak Farrokhzad
c623165742 simplify Token::eat 2022-05-31 16:16:15 +02:00
collin
a230bd1477 remove char 2022-05-26 16:53:57 -04:00
collin
3de06095ed cargo fmt 2022-05-26 16:48:34 -04:00
collin
2327bca617 implement static string type 2022-05-26 16:43:18 -04:00
collin
84c0a82008 add string type to tokenizer + lexer 2022-05-26 15:55:37 -04:00
gluax
4f30e6e896 add ident type back in 2022-05-25 15:56:44 -07:00
collin
e34c35f1b0 merge testnet3 2022-05-25 14:28:03 -04:00
collin
65408acbb5 fix lexer test 2022-05-25 14:10:15 -04:00
collin
8d79193474 merge testnet3 2022-05-25 14:02:10 -04:00
Mazdak Farrokhzad
620b3525d4 misc parser tweaks 2022-05-24 16:48:58 +02:00
collin
b8780e888d merge testnet3 2022-05-20 10:39:21 -04:00
collin
119c191836 merge testnet3 2022-05-18 14:29:54 -04:00
Collin Chin
4ce11080b5
Merge pull request #1825 from AleoHQ/fix-loop-end-inclusive
[parser] Fix to disallow inclusive loop ending bound.
2022-05-18 14:17:32 -04:00
Mazdak Farrokhzad
4237a52696 simplify eat_identifier 2022-05-18 14:46:45 +02:00
Mazdak Farrokhzad
882f2e5454 remove char type + literals 2022-05-18 14:33:04 +02:00
Mazdak Farrokhzad
7f435eba48 remove expression statements 2022-05-17 14:41:30 +02:00
Alessandro Coglio
b1baf90719 [parser] Adhere to style. 2022-05-16 21:27:29 -07:00
Alessandro Coglio
1761b80578 [parser] Fix to disallow including loop ending bound.
This is not part of the current version of Leo (cf. ABNF grammar and Leo
Reference).

Adapt tests.
2022-05-16 21:24:42 -07:00
Alessandro Coglio
4989c50409 [parser] Attempt to fix style check. 2022-05-14 00:03:55 -07:00
Alessandro Coglio
21616fe167 [parser] Remove the input keyword.
This is also not in the current grammar, and it does not look like it is going
to be re-added.
2022-05-13 23:50:33 -07:00
Alessandro Coglio
2fbaf759db [parser] Remove mut and type keywords.
As discussed, these are no longer in the grammar. If and when we need them, we
will re-add them.

This also removes some extra code that gives a specific error when mut is
used. However, that is in fact another bug, because `mut` is a valid identifier
in the current grammar, and thus this extra code unjustly rejects code that uses
`mut` as an identifier.

Adjust some tests and expectations.
2022-05-13 23:36:08 -07:00
collin
f6aa7a578a merge testnet3 2022-05-13 12:33:35 -07:00
collin
bacc0d7510 merge testnet3 2022-05-12 13:18:43 -07:00
collin
c8de6826c2 preserve char scalar nonscalar 2022-05-12 13:16:25 -07:00
Mazdak Farrokhzad
8d915339a0 span refactor: fix build + simplify &span 2022-05-12 16:24:17 +02:00
Mazdak Farrokhzad
8bf06ed872 add remark re. parser benchmarks 2022-05-12 16:12:32 +02:00
Mazdak Farrokhzad
2d6e737f7e span refactor: fix bench 2022-05-12 16:12:32 +02:00
Mazdak Farrokhzad
01a23f6e6e cargo clippy + similar 2022-05-12 16:12:31 +02:00
Mazdak Farrokhzad
a5ad874ffb spans: use source map backing 2022-05-12 16:09:18 +02:00
collin
8f17d6294a rename scalar -> primitive 2022-05-11 14:09:12 -07:00
Alessandro Coglio
62f2267c2b [parser] Fix parsing of ordering expressions.
Follow the grammar rule. The ordering operators are not associative.

Split previous tests into succeeding and failing ones.

Refresh expectations of old test files.

Add expectations of new test files.
2022-05-10 23:32:46 -07:00
collin
60f6b77629 add scalar operation type checking 2022-05-10 16:26:35 -07:00
collin
55260ae5ad add scalar type to ast 2022-05-10 15:34:42 -07:00
collin
9fe4a7281b add scalar type to parser 2022-05-10 15:20:04 -07:00
collin
c1d36ee62e remove const function code 2022-05-10 11:57:23 -07:00
Collin Chin
be9fa96d9e
Merge pull request #1786 from AleoHQ/feature/type-checking
[Impl] type-checking
2022-05-10 11:17:44 -07:00
gluax
d33e69bac8 re-introduce some disabled tests, fix some 2022-05-05 15:38:55 -07:00
collin
214f6bf5d7 make comments consistent 2022-05-04 15:44:41 -07:00
gluax
4fb95d1195 initial commit for tc, adds get_type to Node 2022-05-03 11:26:56 -07:00
gluax
a7c3696e90 merge testnet3 into required types, also remove identifier type 2022-05-02 19:43:46 -07:00
collin
3da1ac802e reorder dependencies 2022-04-29 13:09:27 -07:00
gluax
8cb8c153fc call appropiate input parse function, make suggested changes 2022-04-28 12:26:05 -07:00
gluax
8c7fe53ff6 fix leo input parser bug 2022-04-27 11:52:06 -07:00
gluax
124e6b2e9b
[Impl] Ast Visitor (#1769)
* visitor pattern

* merge upstream, regen grammar readme

* rename reducer to passes

* update comments to properly reflect visitor

* fmt and clippy fixes

* fix comments

Co-authored-by: collin <16715212+collinc97@users.noreply.github.com>
2022-04-22 16:05:50 -07:00
collin
f89966fe32 merge testnet3 2022-04-21 14:37:33 -07:00
Collin Chin
23fca6af47
Merge pull request #1751 from AleoHQ/abnf-bidi-overrides
[ABNF] disallow bidi override codepoints
2022-04-20 09:34:00 -07:00
collin
15660a3ed7 cargo fmt 2022-04-19 14:01:01 -07:00
Eric McCarthy
4fa12a0b33 [lexer] return error if bidi override code point seen in comment, character, or string 2022-04-19 13:00:10 -07:00
gluax
98c7ced6fe merge upstream testnet3 2022-04-19 12:58:28 -07:00
Collin Chin
645b5a2be7
Merge pull request #1750 from AleoHQ/address-check
Address check
2022-04-19 12:56:27 -07:00
Collin Chin
f002637d73
Merge pull request #1748 from AleoHQ/parser-refactor
Parser: store current + previous tokens
2022-04-19 12:55:46 -07:00
gluax
7b849b620c Merge branch 'parser-refactor' of github.com:AleoHQ/leo into feature/warnings 2022-04-19 12:47:06 -07:00
Mazdak Farrokhzad
267fda05e7 simplify parse_assign_statement 2022-04-19 14:11:09 +02:00
gluax
54c936cc61 leo warnings, disable unused errors for now 2022-04-18 14:06:28 -07:00
gluax
c8b44141eb fix some span and input parsing issues 2022-04-18 11:33:43 -07:00
Collin Chin
cd8ac3b8d2
remove unused code and dependencies (#1749) 2022-04-13 17:08:45 -07:00
collin
065f16a93b cargo fmt 2022-04-13 15:25:35 -07:00
collin
f53817c5f5 implement real address literal check 2022-04-13 15:21:08 -07:00
collin
b6fb3d0a36 remove unused code and dependencies 2022-04-13 14:28:01 -07:00
Mazdak Farrokhzad
b955b77ac2 parser: minor cleanup + span fix 2022-04-13 22:52:53 +02:00
Mazdak Farrokhzad
66efa91b08 simplify parse_function_parameter_mode 2022-04-13 22:27:56 +02:00
Mazdak Farrokhzad
31fcc2f216 parser: store (prev_)token 2022-04-13 22:20:48 +02:00
Mazdak Farrokhzad
4ac64710b5 lazify lexer 2022-04-13 21:05:17 +02:00
gluax
ba993b3a83 match pattern cleanup 2022-04-12 13:13:02 -07:00
gluax
198ceee536 fix token and constant pairing 2022-04-12 12:22:52 -07:00
gluax
168080942b better match pattern for catching more error situations 2022-04-12 11:52:12 -07:00
gluax
9f79ca7169 allow const but throw a recoverable error 2022-04-12 11:46:35 -07:00