Commit Graph

4564 Commits

Author SHA1 Message Date
Alessandro Coglio
5f5124d2d0 [ABNF] Fix overlooked update.
Thanks to @gluax for reporting the issue.
2022-06-16 15:18:59 -07:00
Alessandro Coglio
64307d075c [ABNF] Add new operators.
This adds shift (`<<` `>>`) and bitwise logical (`&` `|` `^`) operators.

Their precedence is between the additive and ordering operations, in this order
(higher to lower):
- ... others, to additive
- `<<` and `>>`
- `&`
- `|`
- `^`
- ... others, from ordering

This is consistent with Rust, but not with C and Java, both of which make the
bitwise logical operators lower-precedence than equalities.

The previous ABNF rule names for `conjunctive-expression` and
`disjunctive-expression` have been renamed to be more consistent with the newly
added ones. Also, the rule names "abbreviate" 'conjunctive' and 'disjunctive'
with 'and' and 'or', otherwise the names were a bit too long.
2022-06-16 14:02:22 -07:00
0rphon
94b506cf3f fixed tests 2022-06-16 13:22:32 -07:00
0rphon
66286ca88e more tests 2022-06-16 13:07:40 -07:00
0rphon
1cc47e9d08 more tests 2022-06-16 12:53:53 -07:00
gluax
b656fd5347 fix type checking on certain bitwise operations 2022-06-16 12:49:41 -07:00
0rphon
ed9ca4d6d8 added some tests 2022-06-16 12:06:46 -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
b9f8bafc91 pull latest testnet3 2022-06-15 16:52:49 -07:00
collin
26f04e2eaf core circuit wip 2022-06-15 16:50:21 -07:00
0rphon
c54cf17ce1 resolve conflicts 2022-06-15 16:34:57 -07:00
Collin Chin
db963aabea
Merge pull request #1879 from AleoHQ/test-framework-fix
fixed critical test-framework bug
2022-06-15 16:31:12 -07:00
0rphon
0daffb267b reverted filename path 2022-06-15 16:19:20 -07:00
0rphon
4d07cd4722 clippy 2022-06-15 16:10:49 -07:00
collin
993b86e8c7 add circuit type parsing up to type checking 2022-06-15 16:08:05 -07:00
0rphon
d0cfa983b5 fixed bug 2022-06-15 16:06:26 -07:00
collin
eb2dc0d3b0 Merge branch 'testnet3' of https://github.com/AleoHQ/leo into method-call-expr 2022-06-15 11:34:11 -07:00
collin
3882ec2425 add circuit type to ast 2022-06-15 11:32:19 -07:00
Collin Chin
64c47f8bf9
Merge pull request #1865 from AleoHQ/feature/compiler-benchmarking
[Feature] compiler benchmarking
2022-06-15 10:56:42 -07:00
collin
b2890f393a merge testnet3 2022-06-15 10:23:01 -07:00
collin
007d1d0265 merge testnet3 2022-06-15 10:19:33 -07:00
Mazdak Farrokhzad
eee838abba fixes in special methods parsing 2022-06-15 14:51:44 +02:00
Collin Chin
f45aecd91e
Merge pull request #1875 from AleoHQ/dependabot/cargo/testnet3/reqwest-0.11.11
Bump reqwest from 0.11.10 to 0.11.11
2022-06-14 16:07:53 -07:00
dependabot[bot]
69fa8a8a98
Bump reqwest from 0.11.10 to 0.11.11
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.10 to 0.11.11.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.10...v0.11.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 23:07:47 +00:00
Collin Chin
62541d0ae9
Merge pull request #1870 from AleoHQ/abnf-line-terminators
[ABNF] Fix/improve handling of line terminators.
2022-06-14 16:07:39 -07:00
Collin Chin
abe9ce948a
Merge pull request #1874 from AleoHQ/dependabot/cargo/testnet3/clap-3.2.1
Bump clap from 3.1.18 to 3.2.1
2022-06-14 16:07:13 -07:00
Collin Chin
3f6c9b8d4b
Merge pull request #1869 from AleoHQ/fix-spelling
fix emitted file name
2022-06-14 16:06:12 -07:00
collin
8f4cdb3705 remove unused crates and code 2022-06-14 16:05:27 -07:00
gluax
7b4e97c3af Merge branch 'feature/compiler-benchmarking' of github.com:AleoHQ/leo into feature/compiler-benchmarking 2022-06-14 11:43:22 -07:00
gluax
503956131a remove some comments to clean up 2022-06-14 11:43:00 -07:00
collin
0e59e9bcf9 fix cmp type checking 2022-06-14 10:55:59 -07:00
dependabot[bot]
6cb1f0b940
Bump clap from 3.1.18 to 3.2.1
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.18 to 3.2.1.
- [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.1.18...clap_complete-v3.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 10:33:33 +00:00
collin
6c759b7174 impl unary 2022-06-13 18:35:18 -07:00
collin
831e011f42 use more clear type checking methods 2022-06-13 14:53:01 -07:00
Alessandro Coglio
846c976c63 [ABNF] Add operator calls.
Since these are a method-like syntax for unary and binary operators (as in fact
these are represented as operators in the AST), the nomenclature 'operator call'
seems appropriate, at least for now. There is no need yet to introduce notions
of associated functions (and constants).

The rules explicitly distinguish between unary and binary ones, corresponding to
unary and binary operators. This lets us exclude right away calls with too many
arguments, and gives us a way to distinguish the two kinds.

A trailing comma is allowed at the end of the one argument of binary operator
calls, if one is really inclined to use it, just for syntactic consistency with
other calls (namely, function calls).
2022-06-13 13:24:05 -07:00
0rphon
a738ae67a0 fixed expectation pathing 2022-06-13 11:32:35 -07:00
gluax
274dd461cd some more suggested changes 2022-06-13 09:55:42 -07:00
gluax
2c9a91552c Merge branch 'testnet3' of github.com:AleoHQ/leo into feature/compiler-benchmarking 2022-06-12 09:26:30 -07:00
gluax
3a056220ff doing some recommended changes 2022-06-12 09:26:14 -07:00
Alessandro Coglio
894e0af225 [ABNF] Fix/improve handling of line terminators.
Prohibit line terminators inside string literals. (This does not prohibit
escapes for line feed and/or carriage return; it prohibits actual line feeds and
carriage returns, which would break the string literal across lines.)

Explicate line terminators in block comments, so that an accurate line count can
be obtained more readily from the CSTs. (This is more relevant to the ACL2
formal development than to the Rust implementation, which does not have explicit
CSTs.)

Also reorder slightly some rules within the file.
2022-06-11 15:56:49 -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
4e3ed8d4dc regen tests 2022-06-10 13:02:16 -07:00
collin
44fdcab6b0 fix emitted file name 2022-06-10 12:42:38 -07:00
Collin Chin
e8bff31356
Merge pull request #1864 from AleoHQ/misc-bug-fixes
[Fix] Misc Bug Fixes
2022-06-10 12:24:24 -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