mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-30 13:12:53 +03:00
Merge branch 'migrate-leo-ast' of github.com:AleoHQ/leo into migrate-leo-parser
This commit is contained in:
commit
37b99f84d6
@ -46,7 +46,7 @@ commands:
|
|||||||
jobs:
|
jobs:
|
||||||
check-style:
|
check-style:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@ -61,7 +61,7 @@ jobs:
|
|||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@ -76,7 +76,7 @@ jobs:
|
|||||||
|
|
||||||
# code-cov:
|
# code-cov:
|
||||||
# docker:
|
# docker:
|
||||||
# - image: cimg/rust:1.54.0
|
# - image: cimg/rust:1.56.1
|
||||||
# resource_class: xlarge
|
# resource_class: xlarge
|
||||||
# environment:
|
# environment:
|
||||||
# RUSTC_BOOTSTRAP: 1
|
# RUSTC_BOOTSTRAP: 1
|
||||||
@ -118,7 +118,7 @@ jobs:
|
|||||||
|
|
||||||
leo-executable:
|
leo-executable:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@ -136,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
leo-new:
|
leo-new:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -149,7 +149,7 @@ jobs:
|
|||||||
|
|
||||||
leo-init:
|
leo-init:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -162,7 +162,7 @@ jobs:
|
|||||||
|
|
||||||
leo-clean:
|
leo-clean:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -175,7 +175,7 @@ jobs:
|
|||||||
|
|
||||||
leo-setup:
|
leo-setup:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -188,7 +188,7 @@ jobs:
|
|||||||
|
|
||||||
# leo-add-remove:
|
# leo-add-remove:
|
||||||
# docker:
|
# docker:
|
||||||
# - image: cimg/rust:1.54.0
|
# - image: cimg/rust:1.56.1
|
||||||
# resource_class: xlarge
|
# resource_class: xlarge
|
||||||
# steps:
|
# steps:
|
||||||
# - attach_workspace:
|
# - attach_workspace:
|
||||||
@ -199,22 +199,23 @@ jobs:
|
|||||||
# export LEO=/home/circleci/project/project/bin/leo
|
# export LEO=/home/circleci/project/project/bin/leo
|
||||||
# ./project/.circleci/leo-add-remove.sh
|
# ./project/.circleci/leo-add-remove.sh
|
||||||
|
|
||||||
leo-check-constraints:
|
# todo (collin): uncomment after compiler refactor
|
||||||
docker:
|
# leo-check-constraints:
|
||||||
- image: cimg/rust:1.54.0
|
# docker:
|
||||||
resource_class: xlarge
|
# - image: cimg/rust:1.56.1
|
||||||
steps:
|
# resource_class: xlarge
|
||||||
- attach_workspace:
|
# steps:
|
||||||
at: /home/circleci/project/
|
# - attach_workspace:
|
||||||
- run:
|
# at: /home/circleci/project/
|
||||||
name: leo check constraints for Pedersen Hash
|
# - run:
|
||||||
command: |
|
# name: leo check constraints for Pedersen Hash
|
||||||
export LEO=/home/circleci/project/project/bin/leo
|
# command: |
|
||||||
./project/.circleci/leo-check-constraints.sh
|
# export LEO=/home/circleci/project/project/bin/leo
|
||||||
|
# ./project/.circleci/leo-check-constraints.sh
|
||||||
|
|
||||||
leo-login-logout:
|
leo-login-logout:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -227,7 +228,7 @@ jobs:
|
|||||||
|
|
||||||
leo-clone:
|
leo-clone:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -240,7 +241,7 @@ jobs:
|
|||||||
|
|
||||||
leo-publish:
|
leo-publish:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.54.0
|
- image: cimg/rust:1.56.1
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -270,12 +271,12 @@ workflows:
|
|||||||
- leo-setup:
|
- leo-setup:
|
||||||
requires:
|
requires:
|
||||||
- leo-executable
|
- leo-executable
|
||||||
# - leo-add-remove:
|
# - leo-add-remove:
|
||||||
# requires:
|
# requires:
|
||||||
# - leo-executable
|
# - leo-executable
|
||||||
- leo-check-constraints:
|
# - leo-check-constraints:
|
||||||
requires:
|
# requires:
|
||||||
- leo-executable
|
# - leo-executable
|
||||||
- leo-login-logout:
|
- leo-login-logout:
|
||||||
requires:
|
requires:
|
||||||
- leo-executable
|
- leo-executable
|
||||||
|
3
.github/workflows/wasm.yml
vendored
3
.github/workflows/wasm.yml
vendored
@ -37,6 +37,3 @@ jobs:
|
|||||||
run: wasm-pack build --dev --target nodejs
|
run: wasm-pack build --dev --target nodejs
|
||||||
- name: Install dependencies and run tests
|
- name: Install dependencies and run tests
|
||||||
run: cd tests && npm ci && npm test
|
run: cd tests && npm ci && npm test
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
[hooks]
|
[hooks]
|
||||||
# pre-commit = "cargo clippy && cargo fmt --all -- --check"
|
# pre-commit = "cargo clippy && cargo +nightly fmt --all -- --check"
|
||||||
# temp disable for this branch
|
# temp disable for this branch
|
||||||
[logging]
|
[logging]
|
||||||
verbose = true
|
verbose = true
|
||||||
|
@ -28,10 +28,10 @@ It stores the path to an import and what is being imported.
|
|||||||
#### [Circuits](./src/circuits/circuit.rs)
|
#### [Circuits](./src/circuits/circuit.rs)
|
||||||
|
|
||||||
A circuit node represents a defined Circuit in a Leo Program.
|
A circuit node represents a defined Circuit in a Leo Program.
|
||||||
A order preserving map of these are stored on the Program.
|
An order-preserving map of these are stored on the Program.
|
||||||
Contains the Circuit's name, as well as it's members.
|
Contains the Circuit's name, as well as its members.
|
||||||
The members are a function, or a variable.
|
The members are a function, or a variable, or a constant.
|
||||||
For both of them the Circuit preserves their names.
|
For all of them the Circuit preserves their names.
|
||||||
|
|
||||||
#### [Decorators](./src/annotation.rs)
|
#### [Decorators](./src/annotation.rs)
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ The node stores the name of the annotation, as well as any args passed to it.
|
|||||||
#### [Functions](./src/functions/function.rs)
|
#### [Functions](./src/functions/function.rs)
|
||||||
|
|
||||||
A function node represents a defined function in a Leo Program.
|
A function node represents a defined function in a Leo Program.
|
||||||
A order preserving map of these are stored on the Program.
|
An order-preserving map of these are stored on the Program.
|
||||||
A function node stores the following information:
|
A function node stores the following information:
|
||||||
|
|
||||||
- The annotations applied to the function.
|
- The annotations applied to the function.
|
||||||
@ -54,7 +54,7 @@ A function node stores the following information:
|
|||||||
#### [Global Consts](./src/program.rs)
|
#### [Global Consts](./src/program.rs)
|
||||||
|
|
||||||
A global const is a bit special and has no special node for itself, but rather is a definition statement.
|
A global const is a bit special and has no special node for itself, but rather is a definition statement.
|
||||||
A order preserving map of these are stored on the Program.
|
An order-preserving map of these are stored on the Program.
|
||||||
|
|
||||||
### [Types](./src/types/type_.rs)
|
### [Types](./src/types/type_.rs)
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ The char type resents a character from the inclusive range [0, 10FFFF].
|
|||||||
|
|
||||||
#### Field
|
#### Field
|
||||||
|
|
||||||
The field type an unsigned number up to the modulus length of the field.
|
The field type an unsigned number less than the modulus of the field.
|
||||||
|
|
||||||
#### Group
|
#### Group
|
||||||
|
|
||||||
@ -127,15 +127,20 @@ A integer in the inclusive range [-170141183460469231731687303715884105728, 1701
|
|||||||
|
|
||||||
#### Array
|
#### Array
|
||||||
|
|
||||||
The array type contains another type, then the number of elements of that type greater than 0.
|
The array type contains another type,
|
||||||
|
then the number of elements of that type greater than 0
|
||||||
|
for monodimensional arrays,
|
||||||
|
or a list of such numbers of elements
|
||||||
|
for multidimensional arrays.
|
||||||
|
|
||||||
#### Tuple
|
#### Tuple
|
||||||
|
|
||||||
The tuple type contains n types, where n is greater than or equal to 0.
|
The tuple type contains n types, where n is greater than or equal to 0.
|
||||||
|
|
||||||
#### Circuit
|
#### Identifier
|
||||||
|
|
||||||
The circuit type, every circuit represents a different type.
|
An identifier type is either a circuit type or a type alias;
|
||||||
|
every circuit type represents a different type.
|
||||||
|
|
||||||
#### SelfType
|
#### SelfType
|
||||||
|
|
||||||
@ -153,9 +158,9 @@ An assignment statement node stores the following:
|
|||||||
- **=**
|
- **=**
|
||||||
- **+=**
|
- **+=**
|
||||||
- **-=**
|
- **-=**
|
||||||
- **=**
|
- **\*=**
|
||||||
- **/=**
|
- **/=**
|
||||||
- **=**
|
- **\*\*=**
|
||||||
- **&&=**
|
- **&&=**
|
||||||
- **||=**
|
- **||=**
|
||||||
- The assignee which is a variable that has context of any access expressions on it.
|
- The assignee which is a variable that has context of any access expressions on it.
|
||||||
@ -188,7 +193,7 @@ A definition statement node stores the following:
|
|||||||
- The declaration type:
|
- The declaration type:
|
||||||
- `let` for mutable definitions.
|
- `let` for mutable definitions.
|
||||||
- `const` for cosntant definitions.
|
- `const` for cosntant definitions.
|
||||||
- The names of the varaibles defined.
|
- The names of the variables defined.
|
||||||
- The optional type.
|
- The optional type.
|
||||||
- The values to be assigned to the varaibles.
|
- The values to be assigned to the varaibles.
|
||||||
|
|
||||||
@ -204,7 +209,8 @@ A iteration statement node stores the following:
|
|||||||
|
|
||||||
- The loop iterator variable name.
|
- The loop iterator variable name.
|
||||||
- The expression to define the starting loop value.
|
- The expression to define the starting loop value.
|
||||||
- The expression to define the stoping loop value.
|
- The expression to define the stopping loop value.
|
||||||
|
- A flag indicating whether the stopping value is inclusive or not.
|
||||||
- The block to run for the loop.
|
- The block to run for the loop.
|
||||||
|
|
||||||
#### [Return Statements](./src/statements/return_statement.rs)
|
#### [Return Statements](./src/statements/return_statement.rs)
|
||||||
@ -213,11 +219,11 @@ A return statement node stores the following:
|
|||||||
|
|
||||||
- The expression that is being returned.
|
- The expression that is being returned.
|
||||||
|
|
||||||
### Expressions
|
### [Expressions](./src/expressions/mod.rs)
|
||||||
|
|
||||||
The expression nodes in a Leo Program.
|
The expression nodes in a Leo Program.
|
||||||
|
|
||||||
#### [ArrayAccess Expressions](./src/expression/array_acces.rs)
|
#### [ArrayAccess Expressions](./src/accesses/array_access.rs)
|
||||||
|
|
||||||
An array access expression node stores the following:
|
An array access expression node stores the following:
|
||||||
|
|
||||||
@ -235,9 +241,9 @@ An array init expression node stores the following:
|
|||||||
|
|
||||||
An array inline expression node stores the following:
|
An array inline expression node stores the following:
|
||||||
|
|
||||||
- The elments of an array which is either an spread or an expression.
|
- The elements of an array, each of which is either a spread or an expression.
|
||||||
|
|
||||||
#### [ArrayRangeAccess Expressions](./src/expression/array_range_access.rs)
|
#### [ArrayRangeAccess Expressions](./src/accesses/array_range_access.rs)
|
||||||
|
|
||||||
An array range access expression node stores the following:
|
An array range access expression node stores the following:
|
||||||
|
|
||||||
@ -278,21 +284,23 @@ A call expression node stores the following:
|
|||||||
A circuit init expression node stores the following:
|
A circuit init expression node stores the following:
|
||||||
|
|
||||||
- The name of the circuit expression being initialized.
|
- The name of the circuit expression being initialized.
|
||||||
- The aruments a list of expressions.
|
- The arguments a list of expressions.
|
||||||
|
|
||||||
#### [CircuitMemberAccess Expressions](./src/expression/circuit_member_access.rs)
|
#### [MemberAccess Expressions](./src/accesses/member_access.rs)
|
||||||
|
|
||||||
A circuit member access expression node stores the following:
|
A member access expression node stores the following:
|
||||||
|
|
||||||
- The circut expression being accessed.
|
- The expression being accessed.
|
||||||
- The name of the expression being accessed from the circuit.
|
- The name of the member being accessed.
|
||||||
|
- The optional inferred type.
|
||||||
|
|
||||||
#### [CircuitStaticFunctionAccess Expressions](./src/expression/circuit_static_function_access.rs)
|
#### [StaticAccess Expressions](./src/accesses/static_access.rs)
|
||||||
|
|
||||||
A circuit static function access expression node stores the following:
|
A static function access expression node stores the following:
|
||||||
|
|
||||||
- The circut expression being accessed.
|
- The expression being accessed.
|
||||||
- The name of the expression being statically accessed from the circuit.
|
- The name of the member being statically accessed.
|
||||||
|
- The optional inferred type.
|
||||||
|
|
||||||
#### [Identifier Expressions](./src/common/identifier.rs)
|
#### [Identifier Expressions](./src/common/identifier.rs)
|
||||||
|
|
||||||
@ -308,7 +316,7 @@ A ternary expression node stores the following:
|
|||||||
- The expression returned if the condition is true.
|
- The expression returned if the condition is true.
|
||||||
- The expression returned if the condition is false.
|
- The expression returned if the condition is false.
|
||||||
|
|
||||||
#### [TupleAccess Expressions](./src/expression/tuple_access.rs)
|
#### [TupleAccess Expressions](./src/accesses/tuple_access.rs)
|
||||||
|
|
||||||
A tuple access expression node stores the following:
|
A tuple access expression node stores the following:
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ use std::intrinsics::transmute;
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
/// A helper for `symbols` defined below.
|
/// A helper for `symbols` defined below.
|
||||||
/// The macro's job is to bind conventiently usable `const` items to the symbol names provided.
|
/// The macro's job is to bind conveniently usable `const` items to the symbol names provided.
|
||||||
/// For example, with `symbol { a, b }` you'd have `sym::a` and `sym::b`.
|
/// For example, with `symbol { a, b }` you'd have `sym::a` and `sym::b`.
|
||||||
macro_rules! consts {
|
macro_rules! consts {
|
||||||
($val: expr, $sym:ident $(,)?) => {
|
($val: expr, $sym:ident $(,)?) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user