Commit Graph

398 Commits

Author SHA1 Message Date
gluax
f7314625ff basic use case works, need to clean up, and test more advanced use cases 2021-02-23 14:38:50 -05:00
gluax
0b22e77301 refactor #define x 1u32-> const x: u32 = 1; 2021-02-22 15:57:33 -05:00
gluax
480e6345bb merge master, need to add defines into asg 2021-02-22 12:33:13 -05:00
gluax
f952da330c re-add syntax in, then add deprecation warning for it 2021-02-16 15:33:31 -05:00
gluax
42bea9e93a Merge branch 'master' of github.com:AleoHQ/leo into feature/515-eliminate-const-vars 2021-02-16 14:02:49 -05:00
bors[bot]
fa53e75f51
Merge #641
641: Bug/564 input array len not enforced r=collinc97 a=gluax

Resolves #564, depends on #563. The changes for this branch have pulled from PR #638, which is the PR that fixes #563.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 21:41:53 +00:00
bors[bot]
d418b5330c
Merge #638
638: bug/563-array-input-wrong-dimensions r=collinc97 a=gluax

Closes #563. Fixes the array dimension builder when coming from the input file. Adds a test for it as well.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 21:22:50 +00:00
Collin Chin
20a046bbbb
Merge pull request #643 from AleoHQ/feat/readme_license
Adds READMEs and LICENSEs to each Leo workspace member
2021-02-11 00:58:22 -08:00
bors[bot]
b72b5ac125
Merge #620
620: Feature/254 strengthen import rules r=collinc97 a=gluax

Grammar changes are a bit different than what was suggested in the original feature request #254. However, it should be logically equivalent and I think makes more sense on the rust side.

Closes #254 

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 07:31:56 +00:00
bors[bot]
a97d60eb28
Merge #598
598: [Feature] 374 circuit self access r=collinc97 a=gluax

Feature resolves #374. At the grammar level the following syntax is no longer allowed on self:
```
self[0];
self();
```

Syntax that is allowed at the grammar level is:
```
console.log("b: {}", self::b);
console.log("hmm: {}",self::hmm());
self.hello();
console.log("access: {}", self.a);
```

Note that these changes are only at the grammar level only.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com>
2021-02-11 07:09:43 +00:00
howardwu
777a67fb40 Adds README.md 2021-02-10 22:27:37 -08:00
howardwu
55db999a9e Adds LICENSE.md 2021-02-10 22:23:45 -08:00
gluaxspeed
42fb5ea635 merge from pr 638 2021-02-10 11:59:42 -05:00
gluaxspeed
202f056531 fix pushed but depends on pr #638 2021-02-10 11:57:10 -05:00
gluaxspeed
d211d729d1 refactor pacakge_type -> package_or_packages 2021-02-09 10:57:37 -05:00
gluaxspeed
e48b971789 reverse iter for building array, add test case for it 2021-02-09 10:26:16 -05:00
gluaxspeed
f1bf6c90eb remove const keyword 2021-02-08 10:34:33 -05:00
howardwu
1898cc6840 chore(leo): bump version for new release 2021-02-07 08:14:56 -08:00
gluaxspeed
26f9973e14 resolve merge conflict, asg + grammar tests 2021-02-05 14:20:48 -05:00
gluaxspeed
5fe61daa88 merge lastest master 2021-02-05 13:11:36 -05:00
Collin Chin
770f660f3a
Merge pull request #617 from AleoHQ/const-args
[Feature] Const Function Arguments
2021-02-04 23:05:51 -08:00
Collin Chin
a239e17bb6
Merge pull request #622 from AleoHQ/refactor/compiler
Adds ASG struct, updates ASG to support debug
2021-02-04 22:52:40 -08:00
howardwu
1b99c42470 Adds ASG struct, updates ASG to support debug 2021-02-04 19:21:17 -08:00
howardwu
96c20c6472 Update ast convention 2021-02-04 17:26:52 -08:00
Howard Wu
fd5ce2f393
Merge pull request #585 from AleoHQ/feature/228-implied-circuit-name
[Feature] 228 implied circuit name
2021-02-04 14:28:14 -08:00
Max Bruce
df8ecfc299
Update function_input.rs 2021-02-04 14:23:51 -08:00
gluaxspeed
9d881fd2a4 license fix 2021-02-04 15:15:36 -05:00
gluaxspeed
6ba556ceda fixed imports, but with different syntax that should be logical equivalent 2021-02-04 14:52:57 -05:00
Protryon
9c6eb23a1e const func arguments 2021-02-04 07:35:12 -08:00
gluaxspeed
ba417a9a73 merge lastest master 2021-02-04 09:39:02 -05:00
gluaxspeed
8af1248c58 now works with asg 2021-02-04 09:34:05 -05:00
howardwu
90fc6a9c12 chore(leo): bump version for new release 2021-02-03 13:34:03 -08:00
howardwu
0d907bbb26 chore(leo): bump version for new release 2021-02-03 12:36:17 -08:00
gluaxspeed
cd5811dfd6 merge asg/master, clean up ast implied circuit var 2021-02-03 10:26:08 -05:00
Protryon
80d5c87b8a asg 2021-02-02 11:08:56 -08:00
gluaxspeed
047b06d975 license fix 2021-02-02 13:44:20 -05:00
gluaxspeed
3106647f24 fix tests, some changes to do so 2021-02-02 13:38:15 -05:00
gluaxspeed
eb15269437 clean up a tad 2021-02-02 09:47:54 -05:00
howardwu
c935d6a486 Update license to 2021 2021-02-01 20:26:56 -08:00
gluaxspeed
1cbbee4517 allow static, and calls 2021-02-01 15:20:24 -05:00
gluaxspeed
7affb3e099 restrict self keyword to member access only 2021-02-01 13:04:20 -05:00
collin
38f65a7d81 Merge branch 'master' of github.com:AleoHQ/leo into asg-merge 2021-01-30 16:31:35 -05:00
gluaxspeed
16fcb1c681 syntax is recognized 2021-01-29 14:57:50 -05:00
gluaxspeed
3200a9cea1 pull latest master 2021-01-28 12:01:47 -05:00
gluaxspeed
6082fc9bf3 circuit grammar tests 2021-01-28 12:00:44 -05:00
gluaxspeed
c59ff6d107 implied circuit name works 2021-01-27 17:14:51 -05:00
gluaxspeed
4cfd06b94d astError always included 2021-01-27 13:06:21 -05:00
gluaxspeed
2bda443d9c added more tests 2021-01-27 12:10:34 -05:00
collin
9d2c5587c9 return new AstError in ast main.rs 2021-01-26 14:55:16 -05:00
collin
d7cced6e53 rustup update && cargo clippy 2021-01-26 14:55:15 -05:00
gluaxspeed
c03451fcd8 deprecate @context annotation, temp fix for main.rs in ast, how should we handle this? 2021-01-26 11:21:05 -05:00
gluaxspeed
fe4a101d8d use infallible for cleaner type checking, clean up comments 2021-01-25 15:19:44 -05:00
gluaxspeed
29ff3c90b6 error and error message for deprecated test syntax, fmt, clean up 2021-01-25 15:12:10 -05:00
Protryon
ddfffd7c7b asg base implementation 2021-01-25 07:19:38 -08:00
collin
87bd041620 cargo +nightly clippy 2021-01-21 17:05:16 -05:00
collin
f9be039a7b remove unused grammar paths 2021-01-21 17:02:27 -05:00
collin
cd66497226 deprecate context annotation 2021-01-21 16:55:15 -05:00
gluaxspeed
c619d9e2bb @test no context, deprecate test keyword, cargofmt 2021-01-21 12:28:52 -05:00
gluaxspeed
1d4b30422a @test(...) style works for test + cargo fmt pass 2021-01-21 09:25:36 -05:00
collin
219f2360e5 rustup update && cargo clippy 2021-01-19 13:31:30 -05:00
Protryon
3c063d725f rename conditional expr to ternary 2021-01-14 05:27:31 -08:00
howardwu
1a36a262b8 chore(leo): bump version for new release 2021-01-12 17:03:16 -04:00
collin
fea8bb6d1e Merge branch 'master' of github.com:AleoHQ/leo into ast-cleanup 2021-01-05 13:09:41 -05:00
Protryon
91cac5f9d0 remove custom eq/hash implementations, add node implementations, remove range_or_expression 2020-12-21 05:58:10 -08:00
howardwu
4e321ae8d1 Remove snarkos-models dep from ast 2020-12-20 10:17:02 -04:00
howardwu
f04700018b Remove snarkos-errors dep from ast 2020-12-20 10:15:13 -04:00
collin
9657084001 fix serialization 2020-12-16 15:01:15 -08:00
Protryon
d1276bd95d statement breakout 2020-12-16 15:00:45 -08:00
collin
6e2dcdd1b0 fix serialization 2020-12-16 14:21:57 -05:00
collin
1dbd72c453 Merge branch 'master' of github.com:AleoHQ/leo into expression-breakout 2020-12-16 13:46:43 -05:00
dependabot-preview[bot]
8894f10de7
Bump indexmap from 1.6.0 to 1.6.1
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.6.0...1.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-15 10:44:12 +00:00
howardwu
9038c5a17a chore(leo): bump version for new release 2020-12-14 13:57:01 -04:00
howardwu
babb8ec175 Hotfix cargo fmt 2020-12-14 13:54:46 -04:00
collin
00dac3709a Merge branch 'master' of github.com:AleoHQ/leo into fix/prefer-index-map 2020-12-08 16:07:49 -05:00
Protryon
f9dc75f70c expression breakout 2020-12-07 17:05:44 -08:00
collin
e93100eb6a merge master 2020-12-07 19:55:03 -05:00
collin
4cac0aeb41 merge master, update serialization test 2020-12-07 16:40:34 -05:00
Protryon
b9fb1123de block ast node 2020-12-07 13:28:03 -08:00
collin
5d2136b518 use index map in ast module 2020-12-07 12:05:55 -05:00
collin
3b23eb595a return iterator instead of vector 2020-12-07 11:22:45 -05:00
collin
f1bd5399a1 cargo clippy 2020-12-04 16:47:03 -05:00
collin
0698f5df59 Merge branch 'master' of github.com:AleoHQ/leo into feature/circuit-self-input 2020-12-04 16:41:31 -05:00
collin
df271109c0 Merge branch 'master' of github.com:AleoHQ/leo into feat/clippy 2020-12-04 15:51:08 -05:00
howardwu
dbae691e49 chore(leo): bump version for new release 2020-12-03 16:16:42 -04:00
collin
4e9c2253fe fix failing clippy check 2020-12-02 12:36:50 -05:00
collin
bac106b961 cargo clippy 2020-12-02 12:06:25 -05:00
howardwu
74f7f24b19 chore(leo): bump version for new release 2020-12-01 22:57:11 -04:00
collin
d8c08fedd7 fix tests 2020-12-01 15:37:44 -05:00
collin
7977b20ad2 remove mut variable keyword 2020-12-01 10:19:02 -05:00
collin
82e13edbbe pass mutable reference to circuit variable when 'mut self' keyword is present 2020-12-01 10:12:50 -05:00
collin
74f7749462 pass circuit members into function by value when self keyword is present 2020-11-30 17:54:41 -05:00
collin
efe734afaf add input, self, mut self keyword functionality to ast module 2020-11-23 14:49:20 -05:00
collin
2c72156370 add input keyword objects to ast module 2020-11-23 12:10:58 -05:00
collin
db056b9383 Merge branch 'master' of github.com:AleoHQ/leo into feature/type-inference 2020-11-16 18:08:14 -08:00
collin
848adfa6dd clippy use .any 2020-11-12 16:34:49 -08:00
collin
8c2823410a rename leo ast -> ast 2020-11-12 12:00:27 -08:00
collin
74b346f3e6 remove deprecated names from comments and variables 2020-11-11 12:47:54 -08:00
collin
05a83950e5 bump versions fix conflicts 2020-11-11 12:04:48 -08:00
collin
a29bdbdef2 add check for empty arrays in array initializers 2020-11-10 17:04:55 -08:00
collin
33fae17b35 clippy lints 1 2020-11-10 16:23:55 -08:00
collin
2bb17b496b rename struct alias Ast -> Grammar in ast module 3 2020-11-10 13:34:55 -08:00
collin
cc8337853c rename struct alias Ast -> Grammar in ast module 2 2020-11-10 13:32:25 -08:00
collin
9c9f29c496 rename struct alias Ast -> Grammar in ast module 1 2020-11-10 13:27:43 -08:00
collin
04f4e685ed array type refactor finished. all tests pass 2020-11-10 13:22:18 -08:00
collin
d6686005a3 fix refactored array initializer tests wip 3 2020-11-09 19:26:34 -08:00
collin
aa17355a72 fix refactored array initializer tests wip 1 2020-11-09 14:27:59 -08:00
howardwu
0d966d1d5c chore(leo): bump version for new release 2020-11-06 19:56:12 -08:00
collin
1ae66d9908 add support for refactored array initializer in compiler 2020-11-06 19:42:07 -08:00
collin
d7ff808660 add support for refactored array type in compiler 2020-11-06 16:24:38 -08:00
collin
6f3a235c76 Refactor symbol table array type comparison 2020-11-02 13:28:56 -08:00
collin
cfb3cb7344 Refactor array type parsing 2020-11-02 12:11:53 -08:00
collin
2fdcb043fc Improve doc comments for compiler phases 2020-11-02 09:19:11 -08:00
collin
a8c5885836 rename core-ast -> ast 2020-10-30 17:31:09 -07:00
collin
ffcd93f781 rename ast -> grammar 1 2020-10-30 17:17:17 -07:00
collin
61f4189483 Add documentation for renamed modules 2020-10-30 16:23:18 -07:00
Howard Wu
63335c00e6
Merge pull request #404 from AleoHQ/fix/examples
Fix/examples
2020-10-28 18:04:47 -07:00
Howard Wu
2d931d3e3a
Merge pull request #373 from AleoHQ/feature/license-header
add license header check and missing licenses
2020-10-28 16:52:27 -07:00
collin
fe79cfcf71 merge master 2020-10-26 22:05:03 -07:00
collin
4a746e4a81 cargo fmt license headers 2020-10-21 12:21:40 -07:00
collin
82c3d66847 remove required space after subtraction operator 2020-10-21 11:44:57 -07:00
ljedrz
115b7f2266 test: fix a few CI warnings
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-21 17:26:51 +02:00
ljedrz
5fbbf5e978 perf: don't clone the pest iterator when parsing
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-21 11:12:25 +02:00
Collin Chin
61556cca29
Merge pull request #399 from ljedrz/boxing_improvements
Boxing improvements
2020-10-21 02:10:18 -07:00
collin
3870cf785d fix box accesses 2020-10-21 01:32:09 -07:00
Collin Chin
3c0409da16
Merge branch 'master' into boxing_improvements 2020-10-21 00:51:49 -07:00
Collin Chin
e06e9b9ce6
Merge branch 'master' into alloc_hunting 2020-10-21 00:51:22 -07:00
Collin Chin
c871de27c0
Merge pull request #393 from ljedrz/ast_perf
Change the AST benchmark to a more stable one, remove an unnecessary clone
2020-10-21 00:39:31 -07:00
Collin Chin
93f0f8a17b
Merge branch 'master' into pest_test 2020-10-20 23:40:45 -07:00
collin
f30f615655 impl dynamic checker definition statements 2020-10-20 13:14:16 -07:00
ljedrz
a65ff7d820 perf: reduce boxing when parsing the AST
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-19 12:26:45 +02:00
ljedrz
64774cdab6 refactor: accept &Path instead of PathBuf where sufficient
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-16 17:09:44 +02:00
ljedrz
f59416be1b refactor: pass &Path instead of &PathBuf as arguments
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-16 16:18:46 +02:00
ljedrz
69d35063f2 perf: use .to_string() instead of single-param format!
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-16 15:52:45 +02:00
ljedrz
845671547f perf: don't clone the whole iterator while parsing expressions
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 14:26:11 +02:00
ljedrz
07743b2d75 bench: change the AST bench to a much more complex one
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 13:44:59 +02:00
ljedrz
88bd491684 test: add extra AST pest tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 12:35:04 +02:00
ljedrz
d1ee66a747 feat(ast): handle the empty tuple type
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 12:22:31 +02:00
ljedrz
e2f0848773 fix(ast): disallow single-member tuples
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 11:01:51 +02:00
ljedrz
88cdbd4fe6 refactor(ast): remove the expression_tuple indirection from access_call
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 10:50:26 +02:00
ljedrz
0ccaea86f7 test: introduce AST pest tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-14 10:37:39 +02:00
ljedrz
98baae93c1 clippy: assorted fixes to tests and benches
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-06 15:09:03 +02:00
ljedrz
919c1dcada clippy: fix single_match
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-06 12:50:43 +02:00
ljedrz
b8e22e0c96 clippy: fix write_with_newline
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-05 17:18:29 +02:00
ljedrz
4f46dd2982 clippy: allow module_inception
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-10-05 17:18:25 +02:00
collin
3708c54362 make assignee rule more strict during pest parsing 2020-09-16 14:27:44 -07:00
collin
9ed64a6627 fix conflicts 2020-09-10 16:44:25 -07:00
collin
5e4877e778 fix static call nested and test 2020-09-07 21:56:39 -07:00
collin
59570002f2 mutable self wip 2020-09-05 22:03:02 -07:00
collin
de3564b98d support nested array type in leo programs 2020-09-03 10:02:59 -07:00
howardwu
2620ae7bc2 chore(leo): bump version for new release 2020-09-03 03:08:33 -07:00