diff --git a/leo_ast/common/identifier/struct.Identifier.html b/leo_ast/common/identifier/struct.Identifier.html index e0307c4c99..07e4ffc953 100644 --- a/leo_ast/common/identifier/struct.Identifier.html +++ b/leo_ast/common/identifier/struct.Identifier.html @@ -11,11 +11,11 @@ §id: NodeID

The ID of the node.

Implementations§

source§

impl Identifier

source

pub fn new(name: Symbol, id: NodeID) -> Self

Constructs a new identifier with name and id and a default span.

source

pub fn matches(&self, other: &Self) -> bool

Check if the Identifier name matches the other name.

-

Trait Implementations§

source§

impl Clone for Identifier

source§

fn clone(&self) -> Identifier

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Identifier

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Identifier

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Identifier

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N: Network> From<&Identifier<N>> for Identifier

source§

fn from(id: &IdentifierCore<N>) -> Self

Converts to this type from the input type.
source§

impl From<Identifier> for ProgramId

source§

fn from(name: Identifier) -> Self

Converts to this type from the input type.
source§

impl Hash for Identifier

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where +

Trait Implementations§

source§

impl Clone for Identifier

source§

fn clone(&self) -> Identifier

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Identifier

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Identifier

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Identifier

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N: Network> From<&Identifier<N>> for Identifier

source§

fn from(id: &IdentifierCore<N>) -> Self

Converts to this type from the input type.
source§

impl From<Identifier> for ProgramId

source§

fn from(name: Identifier) -> Self

Converts to this type from the input type.
source§

impl Hash for Identifier

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Node for Identifier

source§

fn span(&self) -> Span

Returns the span of the node.
source§

fn set_span(&mut self, span: Span)

Sets the span of the node.
source§

fn id(&self) -> NodeID

Returns the ID of the node.
source§

fn set_id(&mut self, id: NodeID)

Sets the ID of the node.
source§

impl PartialEq for Identifier

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Identifier

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Identifier

source§

impl Eq for Identifier

Auto Trait Implementations§

§

impl Freeze for Identifier

§

impl RefUnwindSafe for Identifier

§

impl Send for Identifier

§

impl Sync for Identifier

§

impl Unpin for Identifier

§

impl UnwindSafe for Identifier

Blanket Implementations§

source§

impl<T> Any for T
where +sufficient, and should not be overridden without very good reason.

source§

impl Serialize for Identifier

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Identifier

source§

impl Eq for Identifier

Auto Trait Implementations§

§

impl Freeze for Identifier

§

impl RefUnwindSafe for Identifier

§

impl Send for Identifier

§

impl Sync for Identifier

§

impl Unpin for Identifier

§

impl UnwindSafe for Identifier

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, T> DeserializeExt<'de> for T
where diff --git a/leo_ast/common/location/struct.Location.html b/leo_ast/common/location/struct.Location.html index b8ad75fd8e..fd2a4cb9bb 100644 --- a/leo_ast/common/location/struct.Location.html +++ b/leo_ast/common/location/struct.Location.html @@ -1,12 +1,12 @@ Location in leo_ast::common::location - Rust

Struct leo_ast::common::location::Location

source ·
pub struct Location {
     pub program: Option<Symbol>,
     pub name: Symbol,
-}

Fields§

§program: Option<Symbol>§name: Symbol

Implementations§

source§

impl Location

source

pub fn new(program: Option<Symbol>, name: Symbol) -> Location

Trait Implementations§

source§

impl Clone for Location

source§

fn clone(&self) -> Location

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Location

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Location

source§

fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>
where +}

Fields§

§program: Option<Symbol>§name: Symbol

Implementations§

source§

impl Location

source

pub fn new(program: Option<Symbol>, name: Symbol) -> Location

Trait Implementations§

source§

impl Clone for Location

source§

fn clone(&self) -> Location

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Location

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Location

source§

fn deserialize<D>(deserializer: D) -> Result<Location, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&CompositeType> for Location

source§

fn from(composite: &CompositeType) -> Location

Converts to this type from the input type.
source§

impl Hash for Location

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Location

source§

fn eq(&self, other: &Location) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Location

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where +sufficient, and should not be overridden without very good reason.

source§

impl Serialize for Location

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Location

source§

impl StructuralPartialEq for Location

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/leo_ast/expressions/enum.Literal.html b/leo_ast/expressions/enum.Literal.html index 4f44b82c26..29fd37ea0e 100644 --- a/leo_ast/expressions/enum.Literal.html +++ b/leo_ast/expressions/enum.Literal.html @@ -21,7 +21,7 @@ __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

source§

impl Display for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Node for Literal

source§

fn span(&self) -> Span

Returns the span of the node.
source§

fn set_span(&mut self, new_span: Span)

Sets the span of the node.
source§

fn id(&self) -> NodeID

Returns the ID of the node.
source§

fn set_id(&mut self, id: NodeID)

Sets the ID of the node.
source§

impl PartialEq for Literal

source§

fn eq(&self, other: &Literal) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Literal

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

+ __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

§

type Error = ParseIntError

The type returned in the event of a conversion error.
source§

impl Eq for Literal

source§

impl StructuralPartialEq for Literal

Auto Trait Implementations§

§

impl Freeze for Literal

§

impl RefUnwindSafe for Literal

§

impl Send for Literal

§

impl Sync for Literal

§

impl Unpin for Literal

§

impl UnwindSafe for Literal

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/leo_ast/expressions/literal/enum.Literal.html b/leo_ast/expressions/literal/enum.Literal.html index ccb6313ab5..ade94118ee 100644 --- a/leo_ast/expressions/literal/enum.Literal.html +++ b/leo_ast/expressions/literal/enum.Literal.html @@ -21,7 +21,7 @@ __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Node for Literal

source§

fn span(&self) -> Span

Returns the span of the node.
source§

fn set_span(&mut self, new_span: Span)

Sets the span of the node.
source§

fn id(&self) -> NodeID

Returns the ID of the node.
source§

fn set_id(&mut self, id: NodeID)

Sets the ID of the node.
source§

impl PartialEq for Literal

source§

fn eq(&self, other: &Literal) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Literal

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

§

type Error = ParseIntError

The type returned in the event of a conversion error.
source§

impl Eq for Literal

source§

impl StructuralPartialEq for Literal

Auto Trait Implementations§

§

impl Freeze for Literal

§

impl RefUnwindSafe for Literal

§

impl Send for Literal

§

impl Sync for Literal

§

impl Unpin for Literal

§

impl UnwindSafe for Literal

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where diff --git a/leo_ast/struct.Ast.html b/leo_ast/struct.Ast.html index 6659c84f3c..fc97a6e7f9 100644 --- a/leo_ast/struct.Ast.html +++ b/leo_ast/struct.Ast.html @@ -5,16 +5,16 @@ These data types form a tree that begins from a Program type root.

Fields§

§ast: Program

Implementations§

source§

impl Ast

source

pub fn new(program: Program) -> Self

Creates a new AST from a given program tree.

source

pub fn as_repr(&self) -> &Program

Returns a reference to the inner program AST representation.

-
source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String>

Serializes the ast into a JSON string.

-
source

pub fn to_json_value(&self) -> Result<Value>

source

pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>

Serializes the ast into a JSON file.

+
source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String>

Serializes the ast into a JSON string.

+
source

pub fn to_json_value(&self) -> Result<Value>

source

pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>

Serializes the ast into a JSON file.

source

pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<()>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

-
source

pub fn from_json_string(json: &str) -> Result<Self>

Deserializes the JSON string into a ast.

-
source

pub fn from_json_file(path: PathBuf) -> Result<Self>

Deserializes the JSON string into a ast from a file.

+) -> Result<()>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

+
source

pub fn from_json_string(json: &str) -> Result<Self>

Deserializes the JSON string into a ast.

+
source

pub fn from_json_file(path: PathBuf) -> Result<Self>

Deserializes the JSON string into a ast from a file.

Trait Implementations§

source§

impl AsRef<Program> for Ast

source§

fn as_ref(&self) -> &Program

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Ast

source§

fn clone(&self) -> Ast

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ast

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Ast

source§

fn default() -> Ast

Returns the “default value” for a type. Read more
source§

impl PartialEq for Ast

source§

fn eq(&self, other: &Ast) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Ast

source§

impl StructuralPartialEq for Ast

Auto Trait Implementations§

§

impl Freeze for Ast

§

impl !RefUnwindSafe for Ast

§

impl Send for Ast

§

impl !Sync for Ast

§

impl Unpin for Ast

§

impl UnwindSafe for Ast

Blanket Implementations§

source§

impl<T> Any for T
where diff --git a/leo_ast/value/enum.Value.html b/leo_ast/value/enum.Value.html index ac1e20e896..7564bd391f 100644 --- a/leo_ast/value/enum.Value.html +++ b/leo_ast/value/enum.Value.html @@ -17,10 +17,10 @@ U128(u128, Span), Scalar(String, Span), String(String, Span), -

}

Variants§

§

Input(Type, Identifier)

§

Address(String, Span)

§

Boolean(bool, Span)

§

Struct(Identifier, IndexMap<Symbol, Value>)

§

Field(String, Span)

§

Group(Box<GroupLiteral>)

§

I8(i8, Span)

§

I16(i16, Span)

§

I32(i32, Span)

§

I64(i64, Span)

§

I128(i128, Span)

§

U8(u8, Span)

§

U16(u16, Span)

§

U32(u32, Span)

§

U64(u64, Span)

§

U128(u128, Span)

§

Scalar(String, Span)

§

String(String, Span)

Implementations§

source§

impl Value

source

pub(crate) fn abs(self, span: Span) -> Result<Self>

source

pub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>

source

pub(crate) fn neg(self, span: Span) -> Result<Self>

source

pub(crate) fn not(self, span: Span) -> Result<Self>

source

pub(crate) fn add(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn div(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn le(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn is_supported_const_fold_type(&self) -> bool

Trait Implementations§

source§

impl AsRef<Value> for Value

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&Value> for Type

source§

fn from(v: &Value) -> Self

Converts to this type from the input type.
source§

impl From<Value> for Type

source§

fn from(v: Value) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used +
}

Variants§

§

Input(Type, Identifier)

§

Address(String, Span)

§

Boolean(bool, Span)

§

Struct(Identifier, IndexMap<Symbol, Value>)

§

Field(String, Span)

§

Group(Box<GroupLiteral>)

§

I8(i8, Span)

§

I16(i16, Span)

§

I32(i32, Span)

§

I64(i64, Span)

§

I128(i128, Span)

§

U8(u8, Span)

§

U16(u16, Span)

§

U32(u32, Span)

§

U64(u64, Span)

§

U128(u128, Span)

§

Scalar(String, Span)

§

String(String, Span)

Implementations§

source§

impl Value

source

pub(crate) fn abs(self, span: Span) -> Result<Self>

source

pub(crate) fn abs_wrapped(self, span: Span) -> Result<Self>

source

pub(crate) fn neg(self, span: Span) -> Result<Self>

source

pub(crate) fn not(self, span: Span) -> Result<Self>

source

pub(crate) fn add(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn add_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn bitand(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn div(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn div_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn eq(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn ge(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn gt(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn le(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn lt(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn mul(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn mul_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn bitor(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn pow(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn pow_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shl(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shl_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shr(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn shr_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn sub(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn sub_wrapped(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn xor(self, other: Self, span: Span) -> Result<Self>

source

pub(crate) fn is_supported_const_fold_type(&self) -> bool

Trait Implementations§

source§

impl AsRef<Value> for Value

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&Value> for Type

source§

fn from(v: &Value) -> Self

Converts to this type from the input type.
source§

impl From<Value> for Type

source§

fn from(v: Value) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

-
§

type Error = ParseIntError

The type returned in the event of a conversion error.
source§

impl TryFrom<&Value> for i128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where +sufficient, and should not be overridden without very good reason.

source§

impl TryFrom<&Literal> for Value

source§

fn try_from(literal: &Literal) -> Result<Self, Self::Error>

Converts a literal to a value.

+
§

type Error = ParseIntError

The type returned in the event of a conversion error.
source§

impl TryFrom<&Value> for i128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u128

§

type Error = LeoError

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where diff --git a/leo_compiler/compiler/struct.Ast.html b/leo_compiler/compiler/struct.Ast.html index db4a3519ca..ff245a2179 100644 --- a/leo_compiler/compiler/struct.Ast.html +++ b/leo_compiler/compiler/struct.Ast.html @@ -5,20 +5,20 @@ These data types form a tree that begins from a Program type root.

Fields§

§ast: Program

Implementations§

source§

impl Ast

source

pub fn new(program: Program) -> Ast

Creates a new AST from a given program tree.

source

pub fn as_repr(&self) -> &Program

Returns a reference to the inner program AST representation.

-
source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the ast into a JSON string.

-
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

source

pub fn to_json_file( +

source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the ast into a JSON string.

+
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

source

pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>

Serializes the ast into a JSON file.

+) -> Result<(), LeoError>

Serializes the ast into a JSON file.

source

pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

-
source

pub fn from_json_string(json: &str) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast.

-
source

pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast from a file.

+) -> Result<(), LeoError>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

+
source

pub fn from_json_string(json: &str) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast.

+
source

pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast from a file.

Trait Implementations§

source§

impl AsRef<Program> for Ast

source§

fn as_ref(&self) -> &Program

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Ast

source§

fn clone(&self) -> Ast

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ast

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Ast

source§

fn default() -> Ast

Returns the “default value” for a type. Read more
source§

impl PartialEq for Ast

source§

fn eq(&self, other: &Ast) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Ast

source§

impl StructuralPartialEq for Ast

Auto Trait Implementations§

§

impl Freeze for Ast

§

impl !RefUnwindSafe for Ast

§

impl Send for Ast

§

impl !Sync for Ast

§

impl Unpin for Ast

§

impl UnwindSafe for Ast

Blanket Implementations§

source§

impl<T> Any for T
where diff --git a/leo_compiler/compiler/struct.Compiler.html b/leo_compiler/compiler/struct.Compiler.html index 3d7910794c..fc6adb7839 100644 --- a/leo_compiler/compiler/struct.Compiler.html +++ b/leo_compiler/compiler/struct.Compiler.html @@ -1,5 +1,5 @@ Compiler in leo_compiler::compiler - Rust

Struct leo_compiler::compiler::Compiler

source ·
pub struct Compiler<'a, N: Network> {
-    handler: &'a Handler,
+    handler: &'a Handler,
     main_file_path: PathBuf,
     output_directory: PathBuf,
     pub program_name: String,
@@ -9,10 +9,10 @@
     node_builder: NodeBuilder,
     assigner: Assigner,
     type_table: TypeTable,
-    import_stubs: IndexMap<Symbol, Stub>,
+    import_stubs: IndexMap<Symbol, Stub>,
     phantom: PhantomData<N>,
 }
Expand description

The primary entry point of the Leo compiler.

-

Fields§

§handler: &'a Handler

The handler is used for error and warning emissions.

+

Fields§

§handler: &'a Handler

The handler is used for error and warning emissions.

§main_file_path: PathBuf

The path to the main leo file.

§output_directory: PathBuf

The path to where the compiler outputs all generated files.

§program_name: String

The program name,

@@ -22,57 +22,57 @@
§node_builder: NodeBuilder

The NodeCounter used to generate sequentially increasing NodeIDs.

§assigner: Assigner

The Assigner is used to construct (unique) assignment statements.

§type_table: TypeTable

The type table.

-
§import_stubs: IndexMap<Symbol, Stub>

The stubs for imported programs. Produced by Retriever module.

+
§import_stubs: IndexMap<Symbol, Stub>

The stubs for imported programs. Produced by Retriever module.

§phantom: PhantomData<N>

Implementations§

source§

impl<'a, N: Network> Compiler<'a, N>

source

pub fn new( program_name: String, network: String, - handler: &'a Handler, + handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf, compiler_options: Option<CompilerOptions>, - import_stubs: IndexMap<Symbol, Stub> + import_stubs: IndexMap<Symbol, Stub> ) -> Self

Returns a new Leo compiler.

-
source

pub fn checksum(&self) -> Result<String>

Returns a SHA256 checksum of the program file.

+
source

pub fn checksum(&self) -> Result<String>

Returns a SHA256 checksum of the program file.

source

pub fn parse_program_from_string( &mut self, program_string: &str, - name: FileName -) -> Result<()>

Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.

-
source

pub fn parse_program(&mut self) -> Result<()>

Parses and stores the main program file, constructs a syntax tree, and generates a program.

-
source

pub fn symbol_table_pass(&self) -> Result<SymbolTable>

Runs the symbol table pass.

+ name: FileName +) -> Result<()>

Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.

+
source

pub fn parse_program(&mut self) -> Result<()>

Parses and stores the main program file, constructs a syntax tree, and generates a program.

+
source

pub fn symbol_table_pass(&self) -> Result<SymbolTable>

Runs the symbol table pass.

source

pub fn type_checker_pass( &'a self, symbol_table: SymbolTable -) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the type checker pass.

+) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the type checker pass.

source

pub fn loop_unrolling_pass( &mut self, symbol_table: SymbolTable -) -> Result<SymbolTable>

Runs the loop unrolling pass.

+) -> Result<SymbolTable>

Runs the loop unrolling pass.

source

pub fn static_single_assignment_pass( &mut self, symbol_table: &SymbolTable -) -> Result<()>

Runs the static single assignment pass.

-
source

pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>

Runs the flattening pass.

-
source

pub fn destructuring_pass(&mut self) -> Result<()>

Runs the destructuring pass.

-
source

pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>

Runs the function inlining pass.

-
source

pub fn dead_code_elimination_pass(&mut self) -> Result<()>

Runs the dead code elimination pass.

+) -> Result<()>

Runs the static single assignment pass.

+
source

pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>

Runs the flattening pass.

+
source

pub fn destructuring_pass(&mut self) -> Result<()>

Runs the destructuring pass.

+
source

pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>

Runs the function inlining pass.

+
source

pub fn dead_code_elimination_pass(&mut self) -> Result<()>

Runs the dead code elimination pass.

source

pub fn code_generation_pass( &mut self, symbol_table: &SymbolTable, struct_graph: &StructGraph, call_graph: &CallGraph -) -> Result<String>

Runs the code generation pass.

+) -> Result<String>

Runs the code generation pass.

source

pub fn compiler_stages( &mut self -) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the compiler stages.

-
source

pub fn compile(&mut self) -> Result<String>

Returns a compiled Leo program.

-
source

fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>

Writes the AST to a JSON file.

+) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the compiler stages.

+
source

pub fn compile(&mut self) -> Result<String>

Returns a compiled Leo program.

+
source

fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>

Writes the AST to a JSON file.

source

fn write_symbol_table_to_json( &self, file_suffix: &str, symbol_table: &SymbolTable -) -> Result<()>

Writes the Symbol Table to a JSON file.

-
source

pub fn add_import_stubs(&mut self) -> Result<()>

Merges the dependencies defined in program.json with the dependencies imported in .leo file

+) -> Result<()>

Writes the Symbol Table to a JSON file.

+
source

pub fn add_import_stubs(&mut self) -> Result<()>

Merges the dependencies defined in program.json with the dependencies imported in .leo file

Trait Implementations§

source§

impl<'a, N: Clone + Network> Clone for Compiler<'a, N>

source§

fn clone(&self) -> Compiler<'a, N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, N> !Freeze for Compiler<'a, N>

§

impl<'a, N> !RefUnwindSafe for Compiler<'a, N>

§

impl<'a, N> !Send for Compiler<'a, N>

§

impl<'a, N> !Sync for Compiler<'a, N>

§

impl<'a, N> Unpin for Compiler<'a, N>
where N: Unpin,

§

impl<'a, N> !UnwindSafe for Compiler<'a, N>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/leo_compiler/compiler/struct.SymbolTable.html b/leo_compiler/compiler/struct.SymbolTable.html index dc00879288..7e990f1dc1 100644 --- a/leo_compiler/compiler/struct.SymbolTable.html +++ b/leo_compiler/compiler/struct.SymbolTable.html @@ -13,8 +13,8 @@ &self, location: &Location, is_struct: bool, - span: Span -) -> Result<(), LeoError>

Recursively checks if the symbol table contains an entry for the given symbol. + span: Span +) -> Result<(), LeoError>

Recursively checks if the symbol table contains an entry for the given symbol. Leo does not allow any variable shadowing or overlap between different symbols.

source

pub fn scope_index(&mut self) -> usize

Returns the current scope index. Increments the scope index.

@@ -22,35 +22,35 @@ &mut self, location: Location, insert: &Function -) -> Result<(), LeoError>

Inserts a function into the symbol table.

+) -> Result<(), LeoError>

Inserts a function into the symbol table.

source

pub fn insert_struct( &mut self, location: Location, insert: &Composite -) -> Result<(), LeoError>

Inserts a struct into the symbol table.

+) -> Result<(), LeoError>

Inserts a struct into the symbol table.

source

pub fn attach_finalize( &mut self, caller: Location, callee: Location -) -> Result<(), LeoError>

Attach a finalize to a function.

+) -> Result<(), LeoError>

Attach a finalize to a function.

source

pub fn insert_variable( &mut self, location: Location, insert: VariableSymbol -) -> Result<(), LeoError>

Inserts a variable into the symbol table.

+) -> Result<(), LeoError>

Inserts a variable into the symbol table.

source

pub fn insert_futures( &mut self, - program: Symbol, - function: Symbol, + program: Symbol, + function: Symbol, futures: Vec<Location> -) -> Result<(), LeoError>

Inserts futures into the function definition.

+) -> Result<(), LeoError>

Inserts futures into the function definition.

source

pub fn remove_variable_from_current_scope(&mut self, location: Location)

Removes a variable from the symbol table.

source

pub fn insert_block(&mut self) -> usize

Creates a new scope for the block and stores it in the symbol table.

source

pub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>

Attempts to lookup a function in the symbol table.

source

pub fn lookup_struct( &self, location: Location, - main_program: Option<Symbol> + main_program: Option<Symbol> ) -> Option<&Composite>

Attempts to lookup a struct in the symbol table.

source

pub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>

Attempts to lookup a variable in the symbol table.

source

pub fn lookup_variable_in_current_scope( @@ -61,20 +61,20 @@ &self, index: usize ) -> Option<&RefCell<SymbolTable>>

Returns the scope associated with index, if it exists in the symbol table.

-
source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the symbol table into a JSON string.

-
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

Converts the symbol table into a JSON value

+
source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the symbol table into a JSON string.

+
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

Converts the symbol table into a JSON value

source

pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>

source

pub fn to_json_file_without_keys( +) -> Result<(), LeoError>

source

pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>

Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

-
source

pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table.

-
source

pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table from a file.

+) -> Result<(), LeoError>

Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

+
source

pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table.

+
source

pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table from a file.

Trait Implementations§

source§

impl Clone for SymbolTable

source§

fn clone(&self) -> SymbolTable

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SymbolTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for SymbolTable

source§

fn default() -> SymbolTable

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SymbolTable

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>
where diff --git a/leo_compiler/struct.Ast.html b/leo_compiler/struct.Ast.html index ad68be994a..1e6b1d6afa 100644 --- a/leo_compiler/struct.Ast.html +++ b/leo_compiler/struct.Ast.html @@ -5,20 +5,20 @@ These data types form a tree that begins from a Program type root.

Fields§

§ast: Program

Implementations§

source§

impl Ast

source

pub fn new(program: Program) -> Ast

Creates a new AST from a given program tree.

source

pub fn as_repr(&self) -> &Program

Returns a reference to the inner program AST representation.

-
source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the ast into a JSON string.

-
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

source

pub fn to_json_file( +

source

pub fn into_repr(self) -> Program

source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the ast into a JSON string.

+
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

source

pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>

Serializes the ast into a JSON file.

+) -> Result<(), LeoError>

Serializes the ast into a JSON file.

source

pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

-
source

pub fn from_json_string(json: &str) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast.

-
source

pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast from a file.

+) -> Result<(), LeoError>

Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.

+
source

pub fn from_json_string(json: &str) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast.

+
source

pub fn from_json_file(path: PathBuf) -> Result<Ast, LeoError>

Deserializes the JSON string into a ast from a file.

Trait Implementations§

source§

impl AsRef<Program> for Ast

source§

fn as_ref(&self) -> &Program

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Ast

source§

fn clone(&self) -> Ast

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ast

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Ast

source§

fn default() -> Ast

Returns the “default value” for a type. Read more
source§

impl PartialEq for Ast

source§

fn eq(&self, other: &Ast) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Ast

source§

impl StructuralPartialEq for Ast

Auto Trait Implementations§

§

impl Freeze for Ast

§

impl !RefUnwindSafe for Ast

§

impl Send for Ast

§

impl !Sync for Ast

§

impl Unpin for Ast

§

impl UnwindSafe for Ast

Blanket Implementations§

source§

impl<T> Any for T
where diff --git a/leo_compiler/struct.Compiler.html b/leo_compiler/struct.Compiler.html index 3b92156fca..753a369be0 100644 --- a/leo_compiler/struct.Compiler.html +++ b/leo_compiler/struct.Compiler.html @@ -1,5 +1,5 @@ Compiler in leo_compiler - Rust

Struct leo_compiler::Compiler

source ·
pub struct Compiler<'a, N: Network> {
-    handler: &'a Handler,
+    handler: &'a Handler,
     main_file_path: PathBuf,
     output_directory: PathBuf,
     pub program_name: String,
@@ -9,10 +9,10 @@
     node_builder: NodeBuilder,
     assigner: Assigner,
     type_table: TypeTable,
-    import_stubs: IndexMap<Symbol, Stub>,
+    import_stubs: IndexMap<Symbol, Stub>,
     phantom: PhantomData<N>,
 }
Expand description

The primary entry point of the Leo compiler.

-

Fields§

§handler: &'a Handler

The handler is used for error and warning emissions.

+

Fields§

§handler: &'a Handler

The handler is used for error and warning emissions.

§main_file_path: PathBuf

The path to the main leo file.

§output_directory: PathBuf

The path to where the compiler outputs all generated files.

§program_name: String

The program name,

@@ -22,57 +22,57 @@
§node_builder: NodeBuilder

The NodeCounter used to generate sequentially increasing NodeIDs.

§assigner: Assigner

The Assigner is used to construct (unique) assignment statements.

§type_table: TypeTable

The type table.

-
§import_stubs: IndexMap<Symbol, Stub>

The stubs for imported programs. Produced by Retriever module.

+
§import_stubs: IndexMap<Symbol, Stub>

The stubs for imported programs. Produced by Retriever module.

§phantom: PhantomData<N>

Implementations§

source§

impl<'a, N: Network> Compiler<'a, N>

source

pub fn new( program_name: String, network: String, - handler: &'a Handler, + handler: &'a Handler, main_file_path: PathBuf, output_directory: PathBuf, compiler_options: Option<CompilerOptions>, - import_stubs: IndexMap<Symbol, Stub> + import_stubs: IndexMap<Symbol, Stub> ) -> Self

Returns a new Leo compiler.

-
source

pub fn checksum(&self) -> Result<String>

Returns a SHA256 checksum of the program file.

+
source

pub fn checksum(&self) -> Result<String>

Returns a SHA256 checksum of the program file.

source

pub fn parse_program_from_string( &mut self, program_string: &str, - name: FileName -) -> Result<()>

Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.

-
source

pub fn parse_program(&mut self) -> Result<()>

Parses and stores the main program file, constructs a syntax tree, and generates a program.

-
source

pub fn symbol_table_pass(&self) -> Result<SymbolTable>

Runs the symbol table pass.

+ name: FileName +) -> Result<()>

Parses and stores a program file content from a string, constructs a syntax tree, and generates a program.

+
source

pub fn parse_program(&mut self) -> Result<()>

Parses and stores the main program file, constructs a syntax tree, and generates a program.

+
source

pub fn symbol_table_pass(&self) -> Result<SymbolTable>

Runs the symbol table pass.

source

pub fn type_checker_pass( &'a self, symbol_table: SymbolTable -) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the type checker pass.

+) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the type checker pass.

source

pub fn loop_unrolling_pass( &mut self, symbol_table: SymbolTable -) -> Result<SymbolTable>

Runs the loop unrolling pass.

+) -> Result<SymbolTable>

Runs the loop unrolling pass.

source

pub fn static_single_assignment_pass( &mut self, symbol_table: &SymbolTable -) -> Result<()>

Runs the static single assignment pass.

-
source

pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>

Runs the flattening pass.

-
source

pub fn destructuring_pass(&mut self) -> Result<()>

Runs the destructuring pass.

-
source

pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>

Runs the function inlining pass.

-
source

pub fn dead_code_elimination_pass(&mut self) -> Result<()>

Runs the dead code elimination pass.

+) -> Result<()>

Runs the static single assignment pass.

+
source

pub fn flattening_pass(&mut self, symbol_table: &SymbolTable) -> Result<()>

Runs the flattening pass.

+
source

pub fn destructuring_pass(&mut self) -> Result<()>

Runs the destructuring pass.

+
source

pub fn function_inlining_pass(&mut self, call_graph: &CallGraph) -> Result<()>

Runs the function inlining pass.

+
source

pub fn dead_code_elimination_pass(&mut self) -> Result<()>

Runs the dead code elimination pass.

source

pub fn code_generation_pass( &mut self, symbol_table: &SymbolTable, struct_graph: &StructGraph, call_graph: &CallGraph -) -> Result<String>

Runs the code generation pass.

+) -> Result<String>

Runs the code generation pass.

source

pub fn compiler_stages( &mut self -) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the compiler stages.

-
source

pub fn compile(&mut self) -> Result<String>

Returns a compiled Leo program.

-
source

fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>

Writes the AST to a JSON file.

+) -> Result<(SymbolTable, StructGraph, CallGraph)>

Runs the compiler stages.

+
source

pub fn compile(&mut self) -> Result<String>

Returns a compiled Leo program.

+
source

fn write_ast_to_json(&self, file_suffix: &str) -> Result<()>

Writes the AST to a JSON file.

source

fn write_symbol_table_to_json( &self, file_suffix: &str, symbol_table: &SymbolTable -) -> Result<()>

Writes the Symbol Table to a JSON file.

-
source

pub fn add_import_stubs(&mut self) -> Result<()>

Merges the dependencies defined in program.json with the dependencies imported in .leo file

+) -> Result<()>

Writes the Symbol Table to a JSON file.

+
source

pub fn add_import_stubs(&mut self) -> Result<()>

Merges the dependencies defined in program.json with the dependencies imported in .leo file

Trait Implementations§

source§

impl<'a, N: Clone + Network> Clone for Compiler<'a, N>

source§

fn clone(&self) -> Compiler<'a, N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, N> !Freeze for Compiler<'a, N>

§

impl<'a, N> !RefUnwindSafe for Compiler<'a, N>

§

impl<'a, N> !Send for Compiler<'a, N>

§

impl<'a, N> !Sync for Compiler<'a, N>

§

impl<'a, N> Unpin for Compiler<'a, N>
where N: Unpin,

§

impl<'a, N> !UnwindSafe for Compiler<'a, N>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/leo_compiler/struct.SymbolTable.html b/leo_compiler/struct.SymbolTable.html index abd12cc7c0..cf23f3f321 100644 --- a/leo_compiler/struct.SymbolTable.html +++ b/leo_compiler/struct.SymbolTable.html @@ -13,8 +13,8 @@ &self, location: &Location, is_struct: bool, - span: Span -) -> Result<(), LeoError>

Recursively checks if the symbol table contains an entry for the given symbol. + span: Span +) -> Result<(), LeoError>

Recursively checks if the symbol table contains an entry for the given symbol. Leo does not allow any variable shadowing or overlap between different symbols.

source

pub fn scope_index(&mut self) -> usize

Returns the current scope index. Increments the scope index.

@@ -22,35 +22,35 @@ &mut self, location: Location, insert: &Function -) -> Result<(), LeoError>

Inserts a function into the symbol table.

+) -> Result<(), LeoError>

Inserts a function into the symbol table.

source

pub fn insert_struct( &mut self, location: Location, insert: &Composite -) -> Result<(), LeoError>

Inserts a struct into the symbol table.

+) -> Result<(), LeoError>

Inserts a struct into the symbol table.

source

pub fn attach_finalize( &mut self, caller: Location, callee: Location -) -> Result<(), LeoError>

Attach a finalize to a function.

+) -> Result<(), LeoError>

Attach a finalize to a function.

source

pub fn insert_variable( &mut self, location: Location, insert: VariableSymbol -) -> Result<(), LeoError>

Inserts a variable into the symbol table.

+) -> Result<(), LeoError>

Inserts a variable into the symbol table.

source

pub fn insert_futures( &mut self, - program: Symbol, - function: Symbol, + program: Symbol, + function: Symbol, futures: Vec<Location> -) -> Result<(), LeoError>

Inserts futures into the function definition.

+) -> Result<(), LeoError>

Inserts futures into the function definition.

source

pub fn remove_variable_from_current_scope(&mut self, location: Location)

Removes a variable from the symbol table.

source

pub fn insert_block(&mut self) -> usize

Creates a new scope for the block and stores it in the symbol table.

source

pub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>

Attempts to lookup a function in the symbol table.

source

pub fn lookup_struct( &self, location: Location, - main_program: Option<Symbol> + main_program: Option<Symbol> ) -> Option<&Composite>

Attempts to lookup a struct in the symbol table.

source

pub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>

Attempts to lookup a variable in the symbol table.

source

pub fn lookup_variable_in_current_scope( @@ -61,20 +61,20 @@ &self, index: usize ) -> Option<&RefCell<SymbolTable>>

Returns the scope associated with index, if it exists in the symbol table.

-
source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the symbol table into a JSON string.

-
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

Converts the symbol table into a JSON value

+
source

pub fn to_json_string(&self) -> Result<String, LeoError>

Serializes the symbol table into a JSON string.

+
source

pub fn to_json_value(&self) -> Result<Value, LeoError>

Converts the symbol table into a JSON value

source

pub fn to_json_file( &self, path: PathBuf, file_name: &str -) -> Result<(), LeoError>

source

pub fn to_json_file_without_keys( +) -> Result<(), LeoError>

source

pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<(), LeoError>

Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

-
source

pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table.

-
source

pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table from a file.

+) -> Result<(), LeoError>

Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

+
source

pub fn from_json_string(json: &str) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table.

+
source

pub fn from_json_file(path: PathBuf) -> Result<SymbolTable, LeoError>

Deserializes the JSON string into a symbol table from a file.

Trait Implementations§

source§

impl Clone for SymbolTable

source§

fn clone(&self) -> SymbolTable

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SymbolTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for SymbolTable

source§

fn default() -> SymbolTable

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SymbolTable

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<SymbolTable, <__D as Deserializer<'de>>::Error>
where diff --git a/leo_disassembler/fn.disassemble_from_str.html b/leo_disassembler/fn.disassemble_from_str.html index 0dc23c5ffd..73dd2bcdf6 100644 --- a/leo_disassembler/fn.disassemble_from_str.html +++ b/leo_disassembler/fn.disassemble_from_str.html @@ -1,4 +1,4 @@ disassemble_from_str in leo_disassembler - Rust

Function leo_disassembler::disassemble_from_str

source ·
pub fn disassemble_from_str<N: Network>(
     name: &str,
     program: &str
-) -> Result<Stub, UtilError>
\ No newline at end of file +) -> Result<Stub, UtilError>

\ No newline at end of file diff --git a/leo_errors/common/index.html b/leo_errors/common/index.html index 9823564797..7349584cbe 100644 --- a/leo_errors/common/index.html +++ b/leo_errors/common/index.html @@ -1,2 +1,2 @@ -leo_errors::common - Rust

Module leo_errors::common

source ·
Expand description

Contains the common functionalities for defining errors..

+leo_errors::common - Rust

Module leo_errors::common

source ·
Expand description

Contains the common functionalities for defining errors.

Re-exports§

Modules§

  • This module contains a backtraced error and its methods.
  • This module contains a formatted error and its methods.
  • This module contains the macros for making errors easily.
  • This module contains traits for making errors easily.
\ No newline at end of file diff --git a/leo_errors/errors/enum.LeoError.html b/leo_errors/errors/enum.LeoError.html index 14a74cc5b9..8ec7a32fc3 100644 --- a/leo_errors/errors/enum.LeoError.html +++ b/leo_errors/errors/enum.LeoError.html @@ -13,16 +13,16 @@ }
Expand description

The LeoError type that contains all sub error types. This allows a unified error type throughout the Leo crates.

Variants§

§

AstError(AstError)

Represents an AST Error in a Leo Error.

-
§

CliError(CliError)

Represents an CLI Error in a Leo Error.

-
§

CompilerError(CompilerError)

Represents an Compiler Error in a Leo Error.

-
§

PackageError(PackageError)

Represents an Package Error in a Leo Error.

-
§

ParserError(ParserError)

Represents an Parser Error in a Leo Error.

+
§

CliError(CliError)

Represents a CLI Error in a Leo Error.

+
§

CompilerError(CompilerError)

Represents a Compiler Error in a Leo Error.

+
§

PackageError(PackageError)

Represents a Package Error in a Leo Error.

+
§

ParserError(ParserError)

Represents a Parser Error in a Leo Error.

§

TypeCheckerError(TypeCheckerError)

Represents a Type Checker Error in a Leo Error.

§

LoopUnrollerError(LoopUnrollerError)

Represents a Loop Unroller Error in a Leo Error.

§

FlattenError(FlattenError)

Represents a Flatten Error in a Leo Error.

§

LastErrorCode(i32)

Purely for just exiting with the correct status code and not re-displaying an error.

-
§

UtilError(UtilError)

Represents a Utils Error in a Leo Error

+
§

UtilError(UtilError)

Represents a Utils Error in a Leo Error.

§

Anyhow(Error)

Anyhow errors.

Implementations§

source§

impl LeoError

source

pub fn error_code(&self) -> String

Implement error code for each type of Error.

source

pub fn exit_code(&self) -> i32

Implement exit code for each type of Error.

diff --git a/leo_errors/errors/enum.LeoWarning.html b/leo_errors/errors/enum.LeoWarning.html index 0faa5539be..c1588d6821 100644 --- a/leo_errors/errors/enum.LeoWarning.html +++ b/leo_errors/errors/enum.LeoWarning.html @@ -1,10 +1,10 @@ -LeoWarning in leo_errors::errors - Rust

Enum leo_errors::errors::LeoWarning

source ·
pub enum LeoWarning {
+LeoWarning in leo_errors::errors - Rust

Enum leo_errors::errors::LeoWarning

source ·
pub enum LeoWarning {
     ParserWarning(ParserWarning),
     TypeCheckerWarning(TypeCheckerWarning),
-}
Expand description

The LeoWarning type that contains all sub error types. -This allows a unified error type throughout the Leo crates.

-

Variants§

§

ParserWarning(ParserWarning)

Represents an Parser Error in a Leo Error.

-
§

TypeCheckerWarning(TypeCheckerWarning)

Represents a Type Checker Error in a Leo Error.

+}
Expand description

The LeoWarning type that contains all sub warning types. +This allows a unified warning type throughout the Leo crates.

+

Variants§

§

ParserWarning(ParserWarning)

Represents an Parser Warning in a Leo Warning.

+
§

TypeCheckerWarning(TypeCheckerWarning)

Represents a Type Checker Warning in a Leo Warning.

Implementations§

source§

impl LeoWarning

source

pub fn error_code(&self) -> String

Implement warning code for each type of Warning.

Trait Implementations§

source§

impl Debug for LeoWarning

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LeoWarning

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LeoWarning

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ParserWarning> for LeoWarning

source§

fn from(source: ParserWarning) -> Self

Converts to this type from the input type.
source§

impl From<TypeCheckerWarning> for LeoWarning

source§

fn from(source: TypeCheckerWarning) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/leo_errors/errors/index.html b/leo_errors/errors/index.html index a9aaa3418b..257932bad3 100644 --- a/leo_errors/errors/index.html +++ b/leo_errors/errors/index.html @@ -1,4 +1,4 @@ -leo_errors::errors - Rust

Module leo_errors::errors

source ·
Expand description

Contains the errors and warnings for the Leo lang.

+leo_errors::errors - Rust

Module leo_errors::errors

source ·
Expand description

Contains the errors and warnings for the Leo language.

Re-exports§

Modules§

  • Contains the AST error definitions.
  • Contains the CLI error definitions.
  • Contains the Compiler error definitions.
  • Contains the Flattener error definitions.
  • Contains the Loop Unroller error definitions.
  • Contains the Package error definitions.
  • Contains the Parser error definitions.
  • Contains the Type Checker error definitions.
  • Contains the Utils error definitions.

Enums§

  • The LeoError type that contains all sub error types. -This allows a unified error type throughout the Leo crates.
  • The LeoWarning type that contains all sub error types. -This allows a unified error type throughout the Leo crates.

Type Aliases§

  • A global result type for all Leo crates, that defaults the errors to be a LeoError.
\ No newline at end of file +This allows a unified error type throughout the Leo crates.
  • The LeoWarning type that contains all sub warning types. +This allows a unified warning type throughout the Leo crates.
  • Type Aliases§

    • A global result type for all Leo crates, that defaults the errors to be a LeoError.
    \ No newline at end of file diff --git a/leo_errors/index.html b/leo_errors/index.html index da14ceb37f..5bbc7ccfbb 100644 --- a/leo_errors/index.html +++ b/leo_errors/index.html @@ -46,6 +46,6 @@

    §SnarkVM

    When SnarkVM implements better error codes and messages, we can bubble them up.

    §Utils

    The errors related to dependency retrieval in the utils crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters DEP.

    -

    Re-exports§

    Modules§

    • Contains the common functionalities for defining errors..
    • Contains traits and types for channels through which errors go.
    • Contains the errors and warnings for the Leo lang.

    Macros§

    • A macro that given an enum, exit code mask, error code string prefix, +

    Re-exports§

    Modules§

    • Contains the common functionalities for defining errors.
    • Contains traits and types for channels through which errors go.
    • Contains the errors and warnings for the Leo language.

    Macros§

    • A macro that given an enum, exit code mask, error code string prefix, and error methods generated through a DSL creates and generates errors with a unique error code.
    \ No newline at end of file diff --git a/leo_package/build/directory/struct.BuildDirectory.html b/leo_package/build/directory/struct.BuildDirectory.html index fac07569cb..3398708872 100644 --- a/leo_package/build/directory/struct.BuildDirectory.html +++ b/leo_package/build/directory/struct.BuildDirectory.html @@ -1,6 +1,6 @@ -BuildDirectory in leo_package::build::directory - Rust

    Struct leo_package::build::directory::BuildDirectory

    source ·
    pub struct BuildDirectory;

    Implementations§

    source§

    impl BuildDirectory

    source

    pub fn open(path: &Path) -> Result<PathBuf>

    Returns the path to the build directory if it exists.

    -
    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name.

    -
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    +BuildDirectory in leo_package::build::directory - Rust

    Struct leo_package::build::directory::BuildDirectory

    source ·
    pub struct BuildDirectory;

    Implementations§

    source§

    impl BuildDirectory

    source

    pub fn open(path: &Path) -> Result<PathBuf>

    Returns the path to the build directory if it exists.

    +
    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name.

    +
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/fn.parse_file_paths.html b/leo_package/fn.parse_file_paths.html index 5e8c86b57f..32c80a43ae 100644 --- a/leo_package/fn.parse_file_paths.html +++ b/leo_package/fn.parse_file_paths.html @@ -1,4 +1,4 @@ parse_file_paths in leo_package - Rust

    Function leo_package::parse_file_paths

    source ·
    pub(crate) fn parse_file_paths(
         directory: ReadDir,
         file_paths: &mut Vec<PathBuf>
    -) -> Result<()>
    \ No newline at end of file +) -> Result<()>

    \ No newline at end of file diff --git a/leo_package/imports/directory/struct.ImportsDirectory.html b/leo_package/imports/directory/struct.ImportsDirectory.html index f58c759e92..9885ee13dd 100644 --- a/leo_package/imports/directory/struct.ImportsDirectory.html +++ b/leo_package/imports/directory/struct.ImportsDirectory.html @@ -1,7 +1,7 @@ -ImportsDirectory in leo_package::imports::directory - Rust

    Struct leo_package::imports::directory::ImportsDirectory

    source ·
    pub struct ImportsDirectory;

    Implementations§

    source§

    impl ImportsDirectory

    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name if it does not exist.

    -
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    -
    source

    pub fn is_empty(path: &Path) -> Result<bool>

    Returns true if the imports directory does not exist or does not contain files.

    -
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the imports directory.

    +ImportsDirectory in leo_package::imports::directory - Rust

    Struct leo_package::imports::directory::ImportsDirectory

    source ·
    pub struct ImportsDirectory;

    Implementations§

    source§

    impl ImportsDirectory

    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name if it does not exist.

    +
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    +
    source

    pub fn is_empty(path: &Path) -> Result<bool>

    Returns true if the imports directory does not exist or does not contain files.

    +
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the imports directory.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/inputs/directory/fn.parse_file_paths.html b/leo_package/inputs/directory/fn.parse_file_paths.html index 1b5a58356c..bbc13fb6c2 100644 --- a/leo_package/inputs/directory/fn.parse_file_paths.html +++ b/leo_package/inputs/directory/fn.parse_file_paths.html @@ -1,4 +1,4 @@ parse_file_paths in leo_package::inputs::directory - Rust

    Function leo_package::inputs::directory::parse_file_paths

    source ·
    fn parse_file_paths(
         directory: ReadDir,
         file_paths: &mut Vec<PathBuf>
    -) -> Result<()>
    \ No newline at end of file +) -> Result<()>

    \ No newline at end of file diff --git a/leo_package/inputs/directory/struct.InputsDirectory.html b/leo_package/inputs/directory/struct.InputsDirectory.html index 3be222239e..42e6487029 100644 --- a/leo_package/inputs/directory/struct.InputsDirectory.html +++ b/leo_package/inputs/directory/struct.InputsDirectory.html @@ -1,5 +1,5 @@ -InputsDirectory in leo_package::inputs::directory - Rust

    Struct leo_package::inputs::directory::InputsDirectory

    source ·
    pub struct InputsDirectory;

    Implementations§

    source§

    impl InputsDirectory

    source

    pub fn create(path: &Path) -> Result<()>

    Creates a directory at the provided path with the default directory name.

    -
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the input directory.

    +InputsDirectory in leo_package::inputs::directory - Rust

    Struct leo_package::inputs::directory::InputsDirectory

    source ·
    pub struct InputsDirectory;

    Implementations§

    source§

    impl InputsDirectory

    source

    pub fn create(path: &Path) -> Result<()>

    Creates a directory at the provided path with the default directory name.

    +
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the input directory.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html index cb29b629d0..fd1493e673 100644 --- a/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html +++ b/leo_package/outputs/ast_snapshot/struct.SnapshotFile.html @@ -3,8 +3,8 @@ pub snapshot: Snapshot, }
    Expand description

    Generic Snapshot file wrapper. Each package can have up to 3 different snapshots: initial_ast, canonicalization_ast and type_inferenced_ast;

    -

    Fields§

    §package_name: String§snapshot: Snapshot

    Implementations§

    source§

    impl SnapshotFile

    source

    pub fn new(package_name: &str, snapshot: Snapshot) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the serialized struct from the given file path if it exists.

    -
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the serialized struct at the given path if it exists. Returns true on success, +

    Fields§

    §package_name: String§snapshot: Snapshot

    Implementations§

    source§

    impl SnapshotFile

    source

    pub fn new(package_name: &str, snapshot: Snapshot) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the serialized struct from the given file path if it exists.

    +
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the serialized struct at the given path if it exists. Returns true on success, false if the file doesn’t exist, and Error if the file system fails during operation.

    source

    fn snapshot_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for SnapshotFile

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_package/outputs/checksum/struct.ChecksumFile.html b/leo_package/outputs/checksum/struct.ChecksumFile.html index def0ba7fb2..a83b3f87ce 100644 --- a/leo_package/outputs/checksum/struct.ChecksumFile.html +++ b/leo_package/outputs/checksum/struct.ChecksumFile.html @@ -1,8 +1,8 @@ ChecksumFile in leo_package::outputs::checksum - Rust

    Struct leo_package::outputs::checksum::ChecksumFile

    source ·
    pub struct ChecksumFile {
         pub package_name: String,
    -}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl ChecksumFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the checksum from the given file path if it exists.

    -
    source

    pub fn write_to(&self, path: &Path, checksum: String) -> Result<()>

    Writes the given checksum to a file.

    -
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the checksum at the given path if it exists. Returns true on success, +}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl ChecksumFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the checksum from the given file path if it exists.

    +
    source

    pub fn write_to(&self, path: &Path, checksum: String) -> Result<()>

    Writes the given checksum to a file.

    +
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the checksum at the given path if it exists. Returns true on success, false if the file doesn’t exist, and Error if the file system fails during operation.

    source

    fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for ChecksumFile

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_package/outputs/circuit/struct.CircuitFile.html b/leo_package/outputs/circuit/struct.CircuitFile.html index 7a313cccc5..2016ebb713 100644 --- a/leo_package/outputs/circuit/struct.CircuitFile.html +++ b/leo_package/outputs/circuit/struct.CircuitFile.html @@ -1,8 +1,8 @@ CircuitFile in leo_package::outputs::circuit - Rust

    Struct leo_package::outputs::circuit::CircuitFile

    source ·
    pub struct CircuitFile {
         pub package_name: String,
    -}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl CircuitFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the serialized struct from the given file path if it exists.

    -
    source

    pub fn write_to(&self, path: &Path, circuit: String) -> Result<()>

    Writes the given serialized struct to a file.

    -
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the serialized struct at the given path if it exists. Returns true on success, +}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl CircuitFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn exists_at(&self, path: &Path) -> bool

    source

    pub fn read_from(&self, path: &Path) -> Result<String>

    Reads the serialized struct from the given file path if it exists.

    +
    source

    pub fn write_to(&self, path: &Path, circuit: String) -> Result<()>

    Writes the given serialized struct to a file.

    +
    source

    pub fn remove(&self, path: &Path) -> Result<bool>

    Removes the serialized struct at the given path if it exists. Returns true on success, false if the file doesn’t exist, and Error if the file system fails during operation.

    source

    fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for CircuitFile

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_package/outputs/directory/struct.OutputsDirectory.html b/leo_package/outputs/directory/struct.OutputsDirectory.html index e6c87e2ceb..eed4aadfb3 100644 --- a/leo_package/outputs/directory/struct.OutputsDirectory.html +++ b/leo_package/outputs/directory/struct.OutputsDirectory.html @@ -1,5 +1,5 @@ -OutputsDirectory in leo_package::outputs::directory - Rust

    Struct leo_package::outputs::directory::OutputsDirectory

    source ·
    pub struct OutputsDirectory;

    Implementations§

    source§

    impl OutputsDirectory

    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name.

    -
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    +OutputsDirectory in leo_package::outputs::directory - Rust

    Struct leo_package::outputs::directory::OutputsDirectory

    source ·
    pub struct OutputsDirectory;

    Implementations§

    source§

    impl OutputsDirectory

    source

    pub fn create(path: &Path) -> Result<PathBuf>

    Creates a directory at the provided path with the default directory name.

    +
    source

    pub fn remove(path: &Path) -> Result<String>

    Removes the directory at the provided path.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/package/struct.Package.html b/leo_package/package/struct.Package.html index 5ddc7ad345..a169387912 100644 --- a/leo_package/package/struct.Package.html +++ b/leo_package/package/struct.Package.html @@ -3,8 +3,8 @@ pub version: String, pub description: Option<String>, pub license: Option<String>, - pub network: NetworkName, -}

    Fields§

    §name: String§version: String§description: Option<String>§license: Option<String>§network: NetworkName

    Implementations§

    source§

    impl Package

    source

    pub fn new(package_name: &str, network: NetworkName) -> Result<Self>

    source

    pub fn is_aleo_name_valid(name: &str) -> bool

    Returns true if it is a valid Aleo name.

    + pub network: NetworkName, +}

    Fields§

    §name: String§version: String§description: Option<String>§license: Option<String>§network: NetworkName

    Implementations§

    source§

    impl Package

    source

    pub fn new(package_name: &str, network: NetworkName) -> Result<Self>

    source

    pub fn is_aleo_name_valid(name: &str) -> bool

    Returns true if it is a valid Aleo name.

    Aleo names can only contain ASCII alphanumeric characters and underscores.

    source

    pub fn can_initialize(package_name: &str, path: &Path) -> bool

    Returns true if a package is can be initialized at a given path.

    source

    pub fn is_initialized(package_name: &str, path: &Path) -> bool

    Returns true if a package is initialized at the given path

    @@ -12,7 +12,7 @@ package_name: &str, path: &Path, endpoint: String -) -> Result<()>

    Creates a Leo package at the given path

    +) -> Result<()>

    Creates a Leo package at the given path

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for Package

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where diff --git a/leo_package/root/env/struct.Env.html b/leo_package/root/env/struct.Env.html index e22e6199f4..09214db26d 100644 --- a/leo_package/root/env/struct.Env.html +++ b/leo_package/root/env/struct.Env.html @@ -1,7 +1,7 @@ Env in leo_package::root::env - Rust

    Struct leo_package::root::env::Env

    source ·
    pub struct Env<N: Network> {
         private_key: PrivateKey<N>,
         endpoint: String,
    -}

    Fields§

    §private_key: PrivateKey<N>§endpoint: String

    Implementations§

    source§

    impl<N: Network> Env<N>

    source

    pub fn new(private_key: Option<PrivateKey<N>>, endpoint: String) -> Result<Self>

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    Trait Implementations§

    source§

    impl<'de, N: Network> Deserialize<'de> for Env<N>

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where +}

    Fields§

    §private_key: PrivateKey<N>§endpoint: String

    Implementations§

    source§

    impl<N: Network> Env<N>

    source

    pub fn new(private_key: Option<PrivateKey<N>>, endpoint: String) -> Result<Self>

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    Trait Implementations§

    source§

    impl<'de, N: Network> Deserialize<'de> for Env<N>

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl<N: Network> ToString for Env<N>

    source§

    fn to_string(&self) -> String

    Converts the given value to a String. Read more

    Auto Trait Implementations§

    §

    impl<N> Freeze for Env<N>
    where <N as Environment>::Field: Freeze, <N as Environment>::Scalar: Freeze,

    §

    impl<N> RefUnwindSafe for Env<N>
    where diff --git a/leo_package/root/gitignore/struct.Gitignore.html b/leo_package/root/gitignore/struct.Gitignore.html index d04da20256..aa5c66a4c7 100644 --- a/leo_package/root/gitignore/struct.Gitignore.html +++ b/leo_package/root/gitignore/struct.Gitignore.html @@ -1,4 +1,4 @@ -Gitignore in leo_package::root::gitignore - Rust

    Struct leo_package::root::gitignore::Gitignore

    source ·
    pub struct Gitignore;

    Implementations§

    source§

    impl Gitignore

    source

    pub fn new() -> Self

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    source

    fn template(&self) -> String

    Trait Implementations§

    source§

    impl Default for Gitignore

    source§

    fn default() -> Gitignore

    Returns the “default value” for a type. Read more
    source§

    impl<'de> Deserialize<'de> for Gitignore

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where +Gitignore in leo_package::root::gitignore - Rust

    Struct leo_package::root::gitignore::Gitignore

    source ·
    pub struct Gitignore;

    Implementations§

    source§

    impl Gitignore

    source

    pub fn new() -> Self

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    source

    fn template(&self) -> String

    Trait Implementations§

    source§

    impl Default for Gitignore

    source§

    fn default() -> Gitignore

    Returns the “default value” for a type. Read more
    source§

    impl<'de> Deserialize<'de> for Gitignore

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/source/directory/struct.SourceDirectory.html b/leo_package/source/directory/struct.SourceDirectory.html index a81ea4519e..799a35d777 100644 --- a/leo_package/source/directory/struct.SourceDirectory.html +++ b/leo_package/source/directory/struct.SourceDirectory.html @@ -1,6 +1,6 @@ -SourceDirectory in leo_package::source::directory - Rust

    Struct leo_package::source::directory::SourceDirectory

    source ·
    pub struct SourceDirectory;

    Implementations§

    source§

    impl SourceDirectory

    source

    pub fn create(path: &Path) -> Result<()>

    Creates a directory at the provided path with the default directory name.

    -
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the source directory.

    -
    source

    pub fn check_files(paths: &[PathBuf]) -> Result<()>

    Check that the files in the source directory are valid.

    +SourceDirectory in leo_package::source::directory - Rust

    Struct leo_package::source::directory::SourceDirectory

    source ·
    pub struct SourceDirectory;

    Implementations§

    source§

    impl SourceDirectory

    source

    pub fn create(path: &Path) -> Result<()>

    Creates a directory at the provided path with the default directory name.

    +
    source

    pub fn files(path: &Path) -> Result<Vec<PathBuf>>

    Returns a list of files in the source directory.

    +
    source

    pub fn check_files(paths: &[PathBuf]) -> Result<()>

    Check that the files in the source directory are valid.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_package/source/main/struct.MainFile.html b/leo_package/source/main/struct.MainFile.html index c75ef853a3..cfea2d93e0 100644 --- a/leo_package/source/main/struct.MainFile.html +++ b/leo_package/source/main/struct.MainFile.html @@ -1,6 +1,6 @@ MainFile in leo_package::source::main - Rust

    Struct leo_package::source::main::MainFile

    source ·
    pub struct MainFile {
         pub package_name: String,
    -}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl MainFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn filename() -> String

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    source

    fn template(&self) -> String

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for MainFile

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where +}

    Fields§

    §package_name: String

    Implementations§

    source§

    impl MainFile

    source

    pub fn new(package_name: &str) -> Self

    source

    pub fn filename() -> String

    source

    pub fn exists_at(path: &Path) -> bool

    source

    pub fn write_to(self, path: &Path) -> Result<()>

    source

    fn template(&self) -> String

    Trait Implementations§

    source§

    impl<'de> Deserialize<'de> for MainFile

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_parser/constant.KEYWORD_TOKENS.html b/leo_parser/constant.KEYWORD_TOKENS.html index 677dc10718..b5ba48d963 100644 --- a/leo_parser/constant.KEYWORD_TOKENS.html +++ b/leo_parser/constant.KEYWORD_TOKENS.html @@ -1,4 +1,4 @@ -KEYWORD_TOKENS in leo_parser - Rust

    Constant leo_parser::KEYWORD_TOKENS

    source ·
    pub const KEYWORD_TOKENS: &[Token];
    Expand description

    Represents all valid Leo keyword tokens. +KEYWORD_TOKENS in leo_parser - Rust

    Constant leo_parser::KEYWORD_TOKENS

    source ·
    pub const KEYWORD_TOKENS: &[Token];
    Expand description

    Represents all valid Leo keyword tokens. This also includes the boolean literals true and false, unlike the ABNF grammar, which classifies them as literals and not keywords. But for the purposes of our lexer implementation, diff --git a/leo_parser/index.html b/leo_parser/index.html index 8cd7961b42..48f5aa8140 100644 --- a/leo_parser/index.html +++ b/leo_parser/index.html @@ -5,7 +5,7 @@

    §leo-parserCrates.io Authors License

    -

    Re-exports§

    Modules§

    • The parser to convert Leo code text into an Program AST type.
    • tokenizer 🔒
      The tokenizer to convert Leo code text into tokens.

    Constants§

    Re-exports§

    Modules§

    • The parser to convert Leo code text into a Program AST type.
    • tokenizer 🔒
      The tokenizer to convert Leo code text into tokens.

    Constants§

    • Represents all valid Leo keyword tokens. This also includes the boolean literals true and false, unlike the ABNF grammar, which classifies them as literals and not keywords. But for the purposes of our lexer implementation, diff --git a/leo_parser/parser/context/struct.ParserContext.html b/leo_parser/parser/context/struct.ParserContext.html index fb7c42c21a..e88298fffb 100644 --- a/leo_parser/parser/context/struct.ParserContext.html +++ b/leo_parser/parser/context/struct.ParserContext.html @@ -16,7 +16,7 @@ then after a p.bump(), we’ll have p.token = '3'.

      §prev_token: SpannedToken

      The previous token, i.e., if p.tokens = ['3', *, '4'], then after two p.bump()s, we’ll have p.token = '*' and p.prev_token = '3'.

      -
      §disallow_struct_construction: bool

      true if parsing an expression for if and loop statements – means struct inits are not legal

      +
      §disallow_struct_construction: bool

      True if parsing an expression for if and loop statements – means struct inits are not legal.

      §program_name: Option<Symbol>

      The name of the program being parsed.

      §phantom: PhantomData<N>

      Implementations§

      source§

      impl<'a, N: Network> ParserContext<'a, N>

      source

      pub fn new( handler: &'a Handler, @@ -27,7 +27,7 @@

      So e.g., if we had previous = A, current = B, and tokens = [C, D, E], then after p.bump(), the state will be previous = B, current = C, and tokens = [D, E].

      source

      pub(super) fn check(&self, tok: &Token) -> bool

      Checks whether the current token is tok.

      -
      source

      pub(super) fn check_int(&self) -> bool

      Checks whether the current token is a Token::Int(_).

      +
      source

      pub(super) fn check_int(&self) -> bool

      Checks whether the current token is a Token::Integer(_).

      source

      pub(super) fn eat(&mut self, token: &Token) -> bool

      Returns true if the next token is equal to the given token. Advances the parser to the next token.

      source

      pub(super) fn look_ahead<'s, R>( @@ -40,7 +40,7 @@

    source

    pub(super) fn emit_warning(&self, warning: ParserWarning)

    Emit the warning warning.

    source

    pub(crate) fn has_next(&self) -> bool

    Returns true if the next token exists.

    source

    fn mk_ident_prev(&self, name: Symbol) -> Identifier

    At the previous token, return and make an identifier with name.

    -
    source

    pub(super) fn eat_identifier(&mut self) -> Option<Identifier>

    Eats the next token if its an identifier and returns it.

    +
    source

    pub(super) fn eat_identifier(&mut self) -> Option<Identifier>

    Eats the next token if it is an identifier and returns it.

    source

    pub(super) fn expect_identifier(&mut self) -> Result<Identifier>

    Expects an Identifier, or errors.

    source

    pub fn eat_whole_number(&mut self) -> Result<(NonNegativeNumber, Span)>

    Removes the next token if it is a [Token::Integer(_)] and returns it, or None if the next token is not a [Token::Integer(_)] or if the next token does not exist.

    @@ -165,19 +165,19 @@
  • self
  • Returns an expression error if the token cannot be matched.

    -

    source§

    impl<N: Network> ParserContext<'_, N>

    source

    pub fn parse_program(&mut self) -> Result<Program>

    Returns a Program AST if all tokens can be consumed and represent a valid Leo program.

    -
    source

    fn unexpected_item(token: &SpannedToken, expected: &[Token]) -> ParserError

    source

    pub(super) fn parse_import(&mut self) -> Result<(Symbol, (Program, Span))>

    Parses an import statement import foo.leo;.

    -
    source

    fn parse_program_scope(&mut self) -> Result<ProgramScope>

    Parses a program scope program foo.aleo { ... }.

    -
    source

    fn parse_struct_members(&mut self) -> Result<(Vec<Member>, Span)>

    Returns a Vec<Member> AST node if the next tokens represent a struct member.

    -
    source

    pub(super) fn parse_typed_ident(&mut self) -> Result<(Identifier, Type, Span)>

    Parses IDENT: TYPE.

    -
    source

    fn parse_member_variable_declaration(&mut self) -> Result<Member>

    Returns a Member AST node if the next tokens represent a struct member variable.

    -
    source

    pub(super) fn parse_struct(&mut self) -> Result<(Symbol, Composite)>

    Parses a struct or record definition, e.g., struct Foo { ... } or record Foo { ... }.

    -
    source

    pub(super) fn parse_mapping(&mut self) -> Result<(Symbol, Mapping)>

    Parses a mapping declaration, e.g. mapping balances: address => u128.

    -
    source

    pub(super) fn parse_mode(&mut self) -> Result<Mode>

    Returns a [ParamMode] AST node if the next tokens represent a function parameter mode.

    -
    source

    fn parse_input(&mut self) -> Result<Input>

    Returns a Input AST node if the next tokens represent a function output.

    -
    source

    fn parse_output(&mut self) -> Result<Output>

    Returns a Output AST node if the next tokens represent a function output.

    -
    source

    fn parse_annotation(&mut self) -> Result<Annotation>

    Returns an Annotation AST node if the next tokens represent an annotation.

    -
    source

    fn parse_function(&mut self) -> Result<(Symbol, Function)>

    Returns an [(Identifier, Function)] AST node if the next tokens represent a function name +

    source§

    impl<N: Network> ParserContext<'_, N>

    source

    pub fn parse_program(&mut self) -> Result<Program>

    Returns a Program AST if all tokens can be consumed and represent a valid Leo program.

    +
    source

    fn unexpected_item(token: &SpannedToken, expected: &[Token]) -> ParserError

    source

    pub(super) fn parse_import(&mut self) -> Result<(Symbol, (Program, Span))>

    Parses an import statement import foo.leo;.

    +
    source

    fn parse_program_scope(&mut self) -> Result<ProgramScope>

    Parses a program scope program foo.aleo { ... }.

    +
    source

    fn parse_struct_members(&mut self) -> Result<(Vec<Member>, Span)>

    Returns a Vec<Member> AST node if the next tokens represent a struct member.

    +
    source

    pub(super) fn parse_typed_ident(&mut self) -> Result<(Identifier, Type, Span)>

    Parses IDENT: TYPE.

    +
    source

    fn parse_member_variable_declaration(&mut self) -> Result<Member>

    Returns a Member AST node if the next tokens represent a struct member variable.

    +
    source

    pub(super) fn parse_struct(&mut self) -> Result<(Symbol, Composite)>

    Parses a struct or record definition, e.g., struct Foo { ... } or record Foo { ... }.

    +
    source

    pub(super) fn parse_mapping(&mut self) -> Result<(Symbol, Mapping)>

    Parses a mapping declaration, e.g. mapping balances: address => u128.

    +
    source

    pub(super) fn parse_mode(&mut self) -> Result<Mode>

    Returns a [ParamMode] AST node if the next tokens represent a function parameter mode.

    +
    source

    fn parse_input(&mut self) -> Result<Input>

    Returns a Input AST node if the next tokens represent a function output.

    +
    source

    fn parse_output(&mut self) -> Result<Output>

    Returns a Output AST node if the next tokens represent a function output.

    +
    source

    fn parse_annotation(&mut self) -> Result<Annotation>

    Returns an Annotation AST node if the next tokens represent an annotation.

    +
    source

    fn parse_function(&mut self) -> Result<(Symbol, Function)>

    Returns an [(Identifier, Function)] AST node if the next tokens represent a function name and function definition.

    source§

    impl<N: Network> ParserContext<'_, N>

    source

    pub(crate) fn parse_statement(&mut self) -> Result<Statement>

    Returns a Statement AST node if the next tokens represent a statement.

    source

    fn parse_assert_statement(&mut self) -> Result<Statement>

    Returns a AssertStatement AST node if the next tokens represent an assertion statement.

    diff --git a/leo_parser/parser/file/index.html b/leo_parser/parser/file/index.html index 2d81e041e9..0b416f51be 100644 --- a/leo_parser/parser/file/index.html +++ b/leo_parser/parser/file/index.html @@ -1 +1 @@ -leo_parser::parser::file - Rust

    Module leo_parser::parser::file

    source ·
    \ No newline at end of file +leo_parser::parser::file - Rust

    Module leo_parser::parser::file

    source ·
    \ No newline at end of file diff --git a/leo_parser/parser/index.html b/leo_parser/parser/index.html index b1c3b97948..7ed0013267 100644 --- a/leo_parser/parser/index.html +++ b/leo_parser/parser/index.html @@ -1,4 +1,4 @@ -leo_parser::parser - Rust

    Module leo_parser::parser

    source ·
    Expand description

    The parser to convert Leo code text into an Program AST type.

    -

    This module contains the parse() method which calls the underlying tokenize() -method to create a new program ast.

    +leo_parser::parser - Rust

    Module leo_parser::parser

    source ·
    Expand description

    The parser to convert Leo code text into a Program AST type.

    +

    This module contains the parse() function which calls the underlying tokenize() +method to create a new program AST.

    Modules§

    Functions§

    • Creates a new program from a given file path and source code text.
    \ No newline at end of file diff --git a/leo_parser/tokenizer/lexer/index.html b/leo_parser/tokenizer/lexer/index.html index 189cf118dd..4f19684af9 100644 --- a/leo_parser/tokenizer/lexer/index.html +++ b/leo_parser/tokenizer/lexer/index.html @@ -1 +1 @@ -leo_parser::tokenizer::lexer - Rust

    Module leo_parser::tokenizer::lexer

    source ·

    Structs§

    Functions§

    • Eat an identifier, that is, a string matching ‘[a-zA-Z][a-zA-Z\d_]*’, if any.
    • Ensure that string contains no Unicode Bidirectional Override code points.
    • Checks if a char is a Unicode Bidirectional Override code point
    \ No newline at end of file +leo_parser::tokenizer::lexer - Rust

    Module leo_parser::tokenizer::lexer

    source ·

    Structs§

    Functions§

    • Eat an identifier, that is, a string matching ‘[a-zA-Z][a-zA-Z\d_]*’, if any.
    • Ensure that string contains no Unicode Bidirectional Override code points.
    • Checks if a char is a Unicode Bidirectional Override code point
    \ No newline at end of file diff --git a/leo_parser/tokenizer/lexer/struct.SpannedToken.html b/leo_parser/tokenizer/lexer/struct.SpannedToken.html index 442036e53e..09739f8838 100644 --- a/leo_parser/tokenizer/lexer/struct.SpannedToken.html +++ b/leo_parser/tokenizer/lexer/struct.SpannedToken.html @@ -1,9 +1,9 @@ -SpannedToken in leo_parser::tokenizer::lexer - Rust

    Struct leo_parser::tokenizer::lexer::SpannedToken

    source ·
    pub struct SpannedToken {
    +SpannedToken in leo_parser::tokenizer::lexer - Rust

    Struct leo_parser::tokenizer::lexer::SpannedToken

    source ·
    pub struct SpannedToken {
         pub token: Token,
         pub span: Span,
    -}

    Fields§

    §token: Token§span: Span

    Implementations§

    source§

    impl SpannedToken

    source

    pub const fn dummy() -> Self

    Returns a dummy token at a dummy span.

    -

    Trait Implementations§

    source§

    impl Clone for SpannedToken

    source§

    fn clone(&self) -> SpannedToken

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for SpannedToken

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for SpannedToken

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for SpannedToken

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Serialize for SpannedToken

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where +}

    Fields§

    §token: Token§span: Span

    Implementations§

    source§

    impl SpannedToken

    source

    pub const fn dummy() -> Self

    Returns a dummy token at a dummy span.

    +

    Trait Implementations§

    source§

    impl Clone for SpannedToken

    source§

    fn clone(&self) -> SpannedToken

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for SpannedToken

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for SpannedToken

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for SpannedToken

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Serialize for SpannedToken

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where diff --git a/leo_parser/tokenizer/token/constant.KEYWORD_TOKENS.html b/leo_parser/tokenizer/token/constant.KEYWORD_TOKENS.html index c999009c00..d9bd33cdfe 100644 --- a/leo_parser/tokenizer/token/constant.KEYWORD_TOKENS.html +++ b/leo_parser/tokenizer/token/constant.KEYWORD_TOKENS.html @@ -1,4 +1,4 @@ -KEYWORD_TOKENS in leo_parser::tokenizer::token - Rust

    Constant leo_parser::tokenizer::token::KEYWORD_TOKENS

    source ·
    pub const KEYWORD_TOKENS: &[Token];
    Expand description

    Represents all valid Leo keyword tokens. +KEYWORD_TOKENS in leo_parser::tokenizer::token - Rust

    Constant leo_parser::tokenizer::token::KEYWORD_TOKENS

    source ·
    pub const KEYWORD_TOKENS: &[Token];
    Expand description

    Represents all valid Leo keyword tokens. This also includes the boolean literals true and false, unlike the ABNF grammar, which classifies them as literals and not keywords. But for the purposes of our lexer implementation, diff --git a/leo_parser/tokenizer/token/enum.Delimiter.html b/leo_parser/tokenizer/token/enum.Delimiter.html index 2294e44363..eb5f2bb9fb 100644 --- a/leo_parser/tokenizer/token/enum.Delimiter.html +++ b/leo_parser/tokenizer/token/enum.Delimiter.html @@ -1,4 +1,4 @@ -Delimiter in leo_parser::tokenizer::token - Rust

    Enum leo_parser::tokenizer::token::Delimiter

    source ·
    pub enum Delimiter {
    +Delimiter in leo_parser::tokenizer::token - Rust

    Enum leo_parser::tokenizer::token::Delimiter

    source ·
    pub enum Delimiter {
         Parenthesis,
         Brace,
         Bracket,
    @@ -6,8 +6,8 @@
     

    Variants§

    §

    Parenthesis

    ( ... )

    §

    Brace

    { ... }

    §

    Bracket

    [ ... ]

    -

    Implementations§

    source§

    impl Delimiter

    source

    pub fn open_close_pair(self) -> (Token, Token)

    Returns the open/close tokens that the delimiter corresponds to.

    -

    Trait Implementations§

    source§

    impl Clone for Delimiter

    source§

    fn clone(&self) -> Delimiter

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Copy for Delimiter

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    Implementations§

    source§

    impl Delimiter

    source

    pub fn open_close_pair(self) -> (Token, Token)

    Returns the open/close tokens that the delimiter corresponds to.

    +

    Trait Implementations§

    source§

    impl Clone for Delimiter

    source§

    fn clone(&self) -> Delimiter

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Copy for Delimiter

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/leo_parser/tokenizer/token/enum.Token.html b/leo_parser/tokenizer/token/enum.Token.html index 86b2e395b1..ba1014bb3e 100644 --- a/leo_parser/tokenizer/token/enum.Token.html +++ b/leo_parser/tokenizer/token/enum.Token.html @@ -1,4 +1,4 @@ -Token in leo_parser::tokenizer::token - Rust

    Enum leo_parser::tokenizer::token::Token

    source ·
    pub enum Token {
    +Token in leo_parser::tokenizer::token - Rust

    Enum leo_parser::tokenizer::token::Token

    source ·
    pub enum Token {
     
    Show 109 variants CommentLine(String), CommentBlock(String), WhiteSpace, @@ -113,16 +113,23 @@ since it includes comments and whitespace, it corresponds to the notion of ‘lexeme’ in the ABNF grammar. There are also a few other differences, noted in comments below.

    -

    Variants§

    §

    CommentLine(String)

    §

    CommentBlock(String)

    §

    WhiteSpace

    §

    True

    §

    False

    §

    Integer(String)

    §

    AddressLit(String)

    §

    StaticString(String)

    §

    Identifier(Symbol)

    §

    Not

    §

    And

    §

    AndAssign

    §

    Or

    §

    OrAssign

    §

    BitAnd

    §

    BitAndAssign

    §

    BitOr

    §

    BitOrAssign

    §

    BitXor

    §

    BitXorAssign

    §

    Eq

    §

    NotEq

    §

    Lt

    §

    LtEq

    §

    Gt

    §

    GtEq

    §

    Add

    §

    AddAssign

    §

    Sub

    §

    SubAssign

    §

    Mul

    §

    MulAssign

    §

    Div

    §

    DivAssign

    §

    Pow

    §

    PowAssign

    §

    Rem

    §

    RemAssign

    §

    Shl

    §

    ShlAssign

    §

    Shr

    §

    ShrAssign

    §

    Assign

    §

    LeftParen

    §

    RightParen

    §

    LeftSquare

    §

    RightSquare

    §

    LeftCurly

    §

    RightCurly

    §

    Comma

    §

    Dot

    §

    DotDot

    §

    Semicolon

    §

    Colon

    §

    DoubleColon

    §

    Question

    §

    Arrow

    §

    BigArrow

    §

    Underscore

    §

    At

    §

    Address

    §

    Bool

    §

    Field

    §

    Group

    §

    I8

    §

    I16

    §

    I32

    §

    I64

    §

    I128

    §

    Record

    §

    Scalar

    §

    Signature

    §

    String

    §

    Struct

    §

    U8

    §

    U16

    §

    U32

    §

    U64

    §

    U128

    §

    As

    §

    Assert

    §

    AssertEq

    §

    AssertNeq

    §

    Async

    §

    Block

    §

    Console

    §

    Const

    §

    Constant

    §

    Else

    §

    Fn

    §

    For

    §

    Function

    §

    Future

    §

    If

    §

    Import

    §

    In

    §

    Inline

    §

    Let

    §

    Mapping

    §

    Private

    §

    Program

    §

    Public

    §

    Return

    §

    SelfLower

    §

    Transition

    §

    Aleo

    §

    Eof

    §

    Leo

    §

    Network

    Implementations§

    source§

    impl Token

    source

    pub fn is_keyword(&self) -> bool

    Returns true if the self token equals a Leo keyword.

    -
    source

    pub fn keyword_to_symbol(&self) -> Option<Symbol>

    Converts self to the corresponding Symbol if it is_keyword.

    -
    source§

    impl Token

    Variants§

    §

    CommentLine(String)

    §

    CommentBlock(String)

    §

    WhiteSpace

    §

    True

    §

    False

    §

    Integer(String)

    §

    AddressLit(String)

    §

    StaticString(String)

    §

    Identifier(Symbol)

    §

    Not

    §

    And

    §

    AndAssign

    §

    Or

    §

    OrAssign

    §

    BitAnd

    §

    BitAndAssign

    §

    BitOr

    §

    BitOrAssign

    §

    BitXor

    §

    BitXorAssign

    §

    Eq

    §

    NotEq

    §

    Lt

    §

    LtEq

    §

    Gt

    §

    GtEq

    §

    Add

    §

    AddAssign

    §

    Sub

    §

    SubAssign

    §

    Mul

    §

    MulAssign

    §

    Div

    §

    DivAssign

    §

    Pow

    §

    PowAssign

    §

    Rem

    §

    RemAssign

    §

    Shl

    §

    ShlAssign

    §

    Shr

    §

    ShrAssign

    §

    Assign

    §

    LeftParen

    §

    RightParen

    §

    LeftSquare

    §

    RightSquare

    §

    LeftCurly

    §

    RightCurly

    §

    Comma

    §

    Dot

    §

    DotDot

    §

    Semicolon

    §

    Colon

    §

    DoubleColon

    §

    Question

    §

    Arrow

    §

    BigArrow

    §

    Underscore

    §

    At

    §

    Address

    §

    Bool

    §

    Field

    §

    Group

    §

    I8

    §

    I16

    §

    I32

    §

    I64

    §

    I128

    §

    Record

    §

    Scalar

    §

    Signature

    §

    String

    §

    Struct

    §

    U8

    §

    U16

    §

    U32

    §

    U64

    §

    U128

    §

    As

    §

    Assert

    §

    AssertEq

    §

    AssertNeq

    §

    Async

    §

    Block

    §

    Console

    §

    Const

    §

    Constant

    §

    Else

    §

    Fn

    §

    For

    §

    Function

    §

    Future

    §

    If

    §

    Import

    §

    In

    §

    Inline

    §

    Let

    §

    Mapping

    §

    Private

    §

    Program

    §

    Public

    §

    Return

    §

    SelfLower

    §

    Transition

    §

    Aleo

    §

    Eof

    §

    Leo

    §

    Network

    Implementations§

    source§

    impl Token

    source

    pub fn is_keyword(&self) -> bool

    Returns true if the self token equals a Leo keyword.

    +
    source

    pub fn keyword_to_symbol(&self) -> Option<Symbol>

    Converts self to the corresponding Symbol if it is_keyword.

    +
    source§

    impl Token

    source

    fn eat_integer( input: &mut Peekable<impl Iterator<Item = char>> -) -> Result<(usize, Token)>

    Returns a tuple: [(integer length, integer token)] if an integer can be eaten, otherwise returns None. -An integer can be eaten if its bytes are at the front of the given input string.

    -
    source

    pub(crate) fn eat(input: &str) -> Result<(usize, Token)>

    Returns a tuple: [(token length, token)] if the next token can be eaten, otherwise returns an error. -The next token can be eaten if the bytes at the front of the given input string can be scanned into a token.

    +) -> Result<(usize, Token)>

    Returns a tuple: [(integer length, integer token)] if an integer can be eaten. +An integer can be eaten if its characters are at the front of the given input string. +If there is no input, this function returns an error. +If there is input but no integer, this function returns the tuple consisting of +length 0 and a dummy integer token that contains an empty string. +However, this function is always called when the next character is a digit. +This function eats a sequence of one or more digits and underscores +(starting from a digit, as explained above, given when it is called), +which corresponds to a numeral in the ABNF grammar.

    +
    source

    pub(crate) fn eat(input: &str) -> Result<(usize, Token)>

    Returns a tuple: [(token length, token)] if the next token can be eaten, otherwise returns an error. +The next token can be eaten if the characters at the front of the given input string can be scanned into a token.

    Trait Implementations§

    source§

    impl Clone for Token

    source§

    fn clone(&self) -> Token

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Token

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Token

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Token

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl PartialEq for Token

    source§

    fn eq(&self, other: &Token) -> bool

    This method tests for self and other values to be equal, and is used + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Token

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl PartialEq for Token

    source§

    fn eq(&self, other: &Token) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    source§

    impl Serialize for Token

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl Eq for Token

    source§

    impl StructuralPartialEq for Token

    Auto Trait Implementations§

    §

    impl Freeze for Token

    §

    impl RefUnwindSafe for Token

    §

    impl Send for Token

    §

    impl Sync for Token

    §

    impl Unpin for Token

    §

    impl UnwindSafe for Token

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_parser/tokenizer/token/index.html b/leo_parser/tokenizer/token/index.html index 1c0252f7db..346af2d50d 100644 --- a/leo_parser/tokenizer/token/index.html +++ b/leo_parser/tokenizer/token/index.html @@ -1,4 +1,4 @@ -leo_parser::tokenizer::token - Rust

    Module leo_parser::tokenizer::token

    source ·

    Enums§

    • Describes delimiters of a token sequence.
    • Represents all valid Leo syntax tokens.

    Constants§

    • Represents all valid Leo keyword tokens. +leo_parser::tokenizer::token - Rust

      Module leo_parser::tokenizer::token

      source ·

      Enums§

      • Describes delimiters of a token sequence.
      • Represents all valid Leo syntax tokens.

      Constants§

      • Represents all valid Leo keyword tokens. This also includes the boolean literals true and false, unlike the ABNF grammar, which classifies them as literals and not keywords. But for the purposes of our lexer implementation, diff --git a/leo_passes/code_generation/generator/struct.CodeGenerator.html b/leo_passes/code_generation/generator/struct.CodeGenerator.html index 350241c444..f8cd0716cc 100644 --- a/leo_passes/code_generation/generator/struct.CodeGenerator.html +++ b/leo_passes/code_generation/generator/struct.CodeGenerator.html @@ -5,13 +5,13 @@ pub(crate) _call_graph: &'a CallGraph, pub(crate) next_register: u64, pub(crate) current_function: Option<&'a Function>, - pub(crate) variable_mapping: IndexMap<&'a Symbol, String>, - pub(crate) composite_mapping: IndexMap<&'a Symbol, (bool, String)>, - pub(crate) global_mapping: IndexMap<&'a Symbol, String>, + pub(crate) variable_mapping: IndexMap<&'a Symbol, String>, + pub(crate) composite_mapping: IndexMap<&'a Symbol, (bool, String)>, + pub(crate) global_mapping: IndexMap<&'a Symbol, String>, pub(crate) variant: Option<Variant>, pub(crate) program: &'a Program, pub(crate) program_id: Option<ProgramId>, - pub(crate) finalize_caller: Option<Symbol>, + pub(crate) finalize_caller: Option<Symbol>, pub(crate) next_label: u64, pub(crate) conditional_depth: u64,

    }

    Fields§

    §symbol_table: &'a SymbolTable

    The symbol table for the program.

    @@ -20,15 +20,15 @@
    §_call_graph: &'a CallGraph

    The call graph for the program.

    §next_register: u64

    A counter to track the next available register.

    §current_function: Option<&'a Function>

    Reference to the current function.

    -
    §variable_mapping: IndexMap<&'a Symbol, String>

    Mapping of variables to registers.

    -
    §composite_mapping: IndexMap<&'a Symbol, (bool, String)>

    Mapping of composite names to a tuple containing metadata associated with the name. +

    §variable_mapping: IndexMap<&'a Symbol, String>

    Mapping of variables to registers.

    +
    §composite_mapping: IndexMap<&'a Symbol, (bool, String)>

    Mapping of composite names to a tuple containing metadata associated with the name. The first element of the tuple indicate whether the composite is a record or not. The second element of the tuple is a string modifier used for code generation.

    -
    §global_mapping: IndexMap<&'a Symbol, String>

    Mapping of global identifiers to their associated names.

    +
    §global_mapping: IndexMap<&'a Symbol, String>

    Mapping of global identifiers to their associated names.

    §variant: Option<Variant>

    The variant of the function we are currently traversing.

    §program: &'a Program

    A reference to program. This is needed to look up external programs.

    §program_id: Option<ProgramId>

    The program ID of the current program.

    -
    §finalize_caller: Option<Symbol>

    A reference to the finalize caller.

    +
    §finalize_caller: Option<Symbol>

    A reference to the finalize caller.

    §next_label: u64

    A counter to track the next available label.

    §conditional_depth: u64

    The depth of the current conditional block.

    Implementations§

    source§

    impl<'a> CodeGenerator<'a>

    source

    pub fn new( @@ -55,7 +55,7 @@ &self, type_: &'a Type, visibility: Mode -) -> String

    Trait Implementations§

    source§

    impl<'a> Pass for CodeGenerator<'a>

    §

    type Input = (&'a Ast, &'a SymbolTable, &'a TypeTable, &'a DiGraph<Symbol>, &'a DiGraph<Symbol>, &'a Program)

    §

    type Output = Result<String, LeoError>

    source§

    fn do_pass( +) -> String

    Trait Implementations§

    source§

    impl<'a> Pass for CodeGenerator<'a>

    §

    type Input = (&'a Ast, &'a SymbolTable, &'a TypeTable, &'a DiGraph<Symbol>, &'a DiGraph<Symbol>, &'a Program)

    §

    type Output = Result<String, LeoError>

    source§

    fn do_pass( (ast, symbol_table, type_table, struct_graph, call_graph, program): Self::Input ) -> Self::Output

    Runs the compiler pass.

    Auto Trait Implementations§

    §

    impl<'a> Freeze for CodeGenerator<'a>

    §

    impl<'a> !RefUnwindSafe for CodeGenerator<'a>

    §

    impl<'a> !Send for CodeGenerator<'a>

    §

    impl<'a> !Sync for CodeGenerator<'a>

    §

    impl<'a> Unpin for CodeGenerator<'a>

    §

    impl<'a> !UnwindSafe for CodeGenerator<'a>

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where diff --git a/leo_passes/common/assigner/struct.Assigner.html b/leo_passes/common/assigner/struct.Assigner.html index 5c84a9e54a..6fb8950636 100644 --- a/leo_passes/common/assigner/struct.Assigner.html +++ b/leo_passes/common/assigner/struct.Assigner.html @@ -7,7 +7,7 @@ &self, arg: impl Display, separator: impl Display -) -> Symbol

    Return a new unique Symbol from a &str.

    +) -> Symbol

    Return a new unique Symbol from a &str.

    source

    pub fn simple_assign_statement( &self, identifier: Identifier, diff --git a/leo_passes/common/assigner/struct.AssignerInner.html b/leo_passes/common/assigner/struct.AssignerInner.html index 4a4dd191fc..70137d170e 100644 --- a/leo_passes/common/assigner/struct.AssignerInner.html +++ b/leo_passes/common/assigner/struct.AssignerInner.html @@ -7,7 +7,7 @@ &mut self, arg: impl Display, separator: impl Display -) -> Symbol

    Return a new unique Symbol from a &str.

    +) -> Symbol

    Return a new unique Symbol from a &str.

    source

    fn simple_assign_statement( &mut self, identifier: Identifier, diff --git a/leo_passes/common/constant_propagation_table/struct.ConstantPropagationTable.html b/leo_passes/common/constant_propagation_table/struct.ConstantPropagationTable.html index 6995d92d84..6bc9a6c75a 100644 --- a/leo_passes/common/constant_propagation_table/struct.ConstantPropagationTable.html +++ b/leo_passes/common/constant_propagation_table/struct.ConstantPropagationTable.html @@ -1,11 +1,11 @@ ConstantPropagationTable in leo_passes::common::constant_propagation_table - Rust
    pub struct ConstantPropagationTable {
         pub(crate) parent: Option<Box<ConstantPropagationTable>>,
    -    pub(crate) constants: IndexMap<Symbol, Expression>,
    +    pub(crate) constants: IndexMap<Symbol, Expression>,
         pub(crate) scope_index: usize,
         pub(crate) scopes: Vec<RefCell<ConstantPropagationTable>>,
     }

    Fields§

    §parent: Option<Box<ConstantPropagationTable>>

    The parent scope if it exists. For example, the parent scope of a then-block is the scope containing the associated ConditionalStatement.

    -
    §constants: IndexMap<Symbol, Expression>

    The known constants in the current scope +

    §constants: IndexMap<Symbol, Expression>

    The known constants in the current scope This field is populated as necessary.

    §scope_index: usize

    The index of the current scope.

    §scopes: Vec<RefCell<ConstantPropagationTable>>

    The sub-scopes of this scope.

    @@ -13,13 +13,13 @@ Increments the scope index.

    source

    pub fn insert_constant( &mut self, - symbol: Symbol, + symbol: Symbol, expr: Expression -) -> Result<()>

    Inserts a constant into the constant propagation table.

    +) -> Result<()>

    Inserts a constant into the constant propagation table.

    source

    pub fn insert_block(&mut self) -> usize

    Creates a new scope for the block and stores it in the constant propagation table.

    -
    source

    pub fn lookup_constant(&self, symbol: Symbol) -> Option<&Expression>

    Attempts to lookup a constant in the constant propagation table.

    -
    source

    pub fn constant_in_local_scope(&self, symbol: Symbol) -> bool

    Returns true if the constant exists in the local scope

    -
    source

    pub fn constant_in_parent_scope(&self, symbol: Symbol) -> bool

    Returns true if the constant exists in any parent scope

    +
    source

    pub fn lookup_constant(&self, symbol: Symbol) -> Option<&Expression>

    Attempts to lookup a constant in the constant propagation table.

    +
    source

    pub fn constant_in_local_scope(&self, symbol: Symbol) -> bool

    Returns true if the constant exists in the local scope

    +
    source

    pub fn constant_in_parent_scope(&self, symbol: Symbol) -> bool

    Returns true if the constant exists in any parent scope

    source

    pub fn lookup_scope_by_index(&self, index: usize) -> Option<&RefCell<Self>>

    Returns the scope associated with index, if it exists in the constant propagation table

    Trait Implementations§

    source§

    impl Clone for ConstantPropagationTable

    source§

    fn clone(&self) -> ConstantPropagationTable

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for ConstantPropagationTable

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Default for ConstantPropagationTable

    source§

    fn default() -> ConstantPropagationTable

    Returns the “default value” for a type. Read more
    source§

    impl<'de> Deserialize<'de> for ConstantPropagationTable

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Serialize for ConstantPropagationTable

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where diff --git a/leo_passes/common/graph/trait.Node.html b/leo_passes/common/graph/trait.Node.html index 94a23b2411..5ae04d2d73 100644 --- a/leo_passes/common/graph/trait.Node.html +++ b/leo_passes/common/graph/trait.Node.html @@ -1,2 +1,2 @@ Node in leo_passes::common::graph - Rust

    Trait leo_passes::common::graph::Node

    source ·
    pub trait Node: Copy + 'static + Eq + PartialEq + Debug + Hash { }
    Expand description

    A node in a graph.

    -

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl Node for Symbol

    Implementors§

    \ No newline at end of file +

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl Node for Symbol

    Implementors§

    \ No newline at end of file diff --git a/leo_passes/common/graph/type.CallGraph.html b/leo_passes/common/graph/type.CallGraph.html index ab92b857e9..b1af20e73c 100644 --- a/leo_passes/common/graph/type.CallGraph.html +++ b/leo_passes/common/graph/type.CallGraph.html @@ -1,8 +1,8 @@ -CallGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::CallGraph

    source ·
    pub type CallGraph = DiGraph<Symbol>;
    Expand description

    A call graph.

    +CallGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::CallGraph

    source ·
    pub type CallGraph = DiGraph<Symbol>;
    Expand description

    A call graph.

    Aliased Type§

    struct CallGraph {
    -    nodes: IndexSet<Symbol>,
    -    edges: IndexMap<Symbol, IndexSet<Symbol>>,
    -}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    -
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. + nodes: IndexSet<Symbol>, + edges: IndexMap<Symbol, IndexSet<Symbol>>, +}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    +
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. Each entry in the map is a node in the graph, and the set of nodes that it points to.

    \ No newline at end of file diff --git a/leo_passes/common/graph/type.ImportGraph.html b/leo_passes/common/graph/type.ImportGraph.html index 29ef241ce2..3a45176558 100644 --- a/leo_passes/common/graph/type.ImportGraph.html +++ b/leo_passes/common/graph/type.ImportGraph.html @@ -1,8 +1,8 @@ -ImportGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::ImportGraph

    source ·
    pub type ImportGraph = DiGraph<Symbol>;
    Expand description

    An import dependency graph.

    +ImportGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::ImportGraph

    source ·
    pub type ImportGraph = DiGraph<Symbol>;
    Expand description

    An import dependency graph.

    Aliased Type§

    struct ImportGraph {
    -    nodes: IndexSet<Symbol>,
    -    edges: IndexMap<Symbol, IndexSet<Symbol>>,
    -}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    -
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. + nodes: IndexSet<Symbol>, + edges: IndexMap<Symbol, IndexSet<Symbol>>, +}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    +
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. Each entry in the map is a node in the graph, and the set of nodes that it points to.

    \ No newline at end of file diff --git a/leo_passes/common/graph/type.StructGraph.html b/leo_passes/common/graph/type.StructGraph.html index 3bff8980b4..7d26fa9b3f 100644 --- a/leo_passes/common/graph/type.StructGraph.html +++ b/leo_passes/common/graph/type.StructGraph.html @@ -1,8 +1,8 @@ -StructGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::StructGraph

    source ·
    pub type StructGraph = DiGraph<Symbol>;
    Expand description

    A struct dependency graph.

    +StructGraph in leo_passes::common::graph - Rust

    Type Alias leo_passes::common::graph::StructGraph

    source ·
    pub type StructGraph = DiGraph<Symbol>;
    Expand description

    A struct dependency graph.

    Aliased Type§

    struct StructGraph {
    -    nodes: IndexSet<Symbol>,
    -    edges: IndexMap<Symbol, IndexSet<Symbol>>,
    -}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    -
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. + nodes: IndexSet<Symbol>, + edges: IndexMap<Symbol, IndexSet<Symbol>>, +}

    Fields§

    §nodes: IndexSet<Symbol>

    The set of nodes in the graph.

    +
    §edges: IndexMap<Symbol, IndexSet<Symbol>>

    The directed edges in the graph. Each entry in the map is a node in the graph, and the set of nodes that it points to.

    \ No newline at end of file diff --git a/leo_passes/common/rename_table/struct.RenameTable.html b/leo_passes/common/rename_table/struct.RenameTable.html index 372f1ee50b..ccdd6d9846 100644 --- a/leo_passes/common/rename_table/struct.RenameTable.html +++ b/leo_passes/common/rename_table/struct.RenameTable.html @@ -1,19 +1,19 @@ RenameTable in leo_passes::common::rename_table - Rust

    Struct leo_passes::common::rename_table::RenameTable

    source ·
    pub struct RenameTable {
         pub(crate) parent: Option<Box<RenameTable>>,
    -    names: IndexMap<Symbol, Symbol>,
    -    ids: IndexMap<Symbol, NodeID>,
    +    names: IndexMap<Symbol, Symbol>,
    +    ids: IndexMap<Symbol, NodeID>,
     }
    Expand description

    RenameTable tracks the names assigned by static single assignment in a single scope.

    Fields§

    §parent: Option<Box<RenameTable>>

    The RenameTable of the parent scope.

    -
    §names: IndexMap<Symbol, Symbol>

    The mapping from names in the original AST to new names in the renamed AST.

    -
    §ids: IndexMap<Symbol, NodeID>

    The mapping from symbols to node IDs. +

    §names: IndexMap<Symbol, Symbol>

    The mapping from names in the original AST to new names in the renamed AST.

    +
    §ids: IndexMap<Symbol, NodeID>

    The mapping from symbols to node IDs. These are used to ensure that newly introduced symbols reference the appropriate information that has been previously indexed by node ID. e,g. TypeTable.

    Implementations§

    source§

    impl RenameTable

    source

    pub(crate) fn new(parent: Option<Box<RenameTable>>) -> Self

    Create a new RenameTable with the given parent.

    -
    source

    pub(crate) fn local_names(&self) -> impl Iterator<Item = &Symbol>

    Returns the symbols that were renamed in the current scope.

    -
    source

    pub(crate) fn update(&mut self, symbol: Symbol, new_symbol: Symbol, id: NodeID)

    Updates self.mapping with the desired entry. +

    source

    pub(crate) fn local_names(&self) -> impl Iterator<Item = &Symbol>

    Returns the symbols that were renamed in the current scope.

    +
    source

    pub(crate) fn update(&mut self, symbol: Symbol, new_symbol: Symbol, id: NodeID)

    Updates self.mapping with the desired entry. Creates a new entry if symbol is not already in self.mapping.

    -
    source

    pub(crate) fn lookup(&self, symbol: Symbol) -> Option<&Symbol>

    Looks up the new name for symbol, recursively checking the parent if it is not found.

    -
    source

    pub(crate) fn lookup_id(&self, symbol: &Symbol) -> Option<&NodeID>

    Looks up the node ID for symbol, recursively checking the parent if it is not found.

    +
    source

    pub(crate) fn lookup(&self, symbol: Symbol) -> Option<&Symbol>

    Looks up the new name for symbol, recursively checking the parent if it is not found.

    +
    source

    pub(crate) fn lookup_id(&self, symbol: &Symbol) -> Option<&NodeID>

    Looks up the node ID for symbol, recursively checking the parent if it is not found.

    Trait Implementations§

    source§

    impl Clone for RenameTable

    source§

    fn clone(&self) -> RenameTable

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for RenameTable

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Default for RenameTable

    source§

    fn default() -> RenameTable

    Returns the “default value” for a type. Read more
    source§

    impl PartialEq for RenameTable

    source§

    fn eq(&self, other: &RenameTable) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    source§

    impl Eq for RenameTable

    source§

    impl StructuralPartialEq for RenameTable

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_passes/common/symbol_table/function_symbol/struct.FunctionSymbol.html b/leo_passes/common/symbol_table/function_symbol/struct.FunctionSymbol.html index 9b598cf3ec..26bf933e86 100644 --- a/leo_passes/common/symbol_table/function_symbol/struct.FunctionSymbol.html +++ b/leo_passes/common/symbol_table/function_symbol/struct.FunctionSymbol.html @@ -2,7 +2,7 @@ pub(crate) id: usize, pub(crate) output_type: Type, pub variant: Variant, - pub(crate) _span: Span, + pub(crate) _span: Span, pub(crate) input: Vec<Input>, pub(crate) future_inputs: Vec<Location>, pub(crate) finalize: Option<Location>, @@ -10,7 +10,7 @@

    Fields§

    §id: usize

    The index associated with the scope in the parent symbol table.

    §output_type: Type

    The output type of the function.

    §variant: Variant

    Is this function a transition, inlined, or a regular function?.

    -
    §_span: Span

    The Span associated with the function.

    +
    §_span: Span

    The Span associated with the function.

    §input: Vec<Input>

    The inputs to the function.

    §future_inputs: Vec<Location>

    Future inputs.

    §finalize: Option<Location>

    The finalize block associated with the function.

    diff --git a/leo_passes/common/symbol_table/struct.SymbolTable.html b/leo_passes/common/symbol_table/struct.SymbolTable.html index 529073cf38..5e92cc2439 100644 --- a/leo_passes/common/symbol_table/struct.SymbolTable.html +++ b/leo_passes/common/symbol_table/struct.SymbolTable.html @@ -19,41 +19,41 @@ &self, location: &Location, is_struct: bool, - span: Span -) -> Result<()>

    Recursively checks if the symbol table contains an entry for the given symbol. + span: Span +) -> Result<()>

    Recursively checks if the symbol table contains an entry for the given symbol. Leo does not allow any variable shadowing or overlap between different symbols.

    source

    pub fn scope_index(&mut self) -> usize

    Returns the current scope index. Increments the scope index.

    -
    source

    pub fn insert_fn(&mut self, location: Location, insert: &Function) -> Result<()>

    Inserts a function into the symbol table.

    +
    source

    pub fn insert_fn(&mut self, location: Location, insert: &Function) -> Result<()>

    Inserts a function into the symbol table.

    source

    pub fn insert_struct( &mut self, location: Location, insert: &Composite -) -> Result<()>

    Inserts a struct into the symbol table.

    +) -> Result<()>

    Inserts a struct into the symbol table.

    source

    fn check_eq_struct(&self, new: &Composite, old: &Composite) -> bool

    Checks if two structs are equal.

    source

    pub fn attach_finalize( &mut self, caller: Location, callee: Location -) -> Result<()>

    Attach a finalize to a function.

    +) -> Result<()>

    Attach a finalize to a function.

    source

    pub fn insert_variable( &mut self, location: Location, insert: VariableSymbol -) -> Result<()>

    Inserts a variable into the symbol table.

    +) -> Result<()>

    Inserts a variable into the symbol table.

    source

    pub fn insert_futures( &mut self, - program: Symbol, - function: Symbol, + program: Symbol, + function: Symbol, futures: Vec<Location> -) -> Result<()>

    Inserts futures into the function definition.

    +) -> Result<()>

    Inserts futures into the function definition.

    source

    pub fn remove_variable_from_current_scope(&mut self, location: Location)

    Removes a variable from the symbol table.

    source

    pub fn insert_block(&mut self) -> usize

    Creates a new scope for the block and stores it in the symbol table.

    source

    pub fn lookup_fn_symbol(&self, location: Location) -> Option<&FunctionSymbol>

    Attempts to lookup a function in the symbol table.

    source

    pub fn lookup_struct( &self, location: Location, - main_program: Option<Symbol> + main_program: Option<Symbol> ) -> Option<&Composite>

    Attempts to lookup a struct in the symbol table.

    source

    pub fn lookup_variable(&self, location: Location) -> Option<&VariableSymbol>

    Attempts to lookup a variable in the symbol table.

    source

    pub fn lookup_variable_in_current_scope( @@ -61,16 +61,16 @@ location: Location ) -> Option<&VariableSymbol>

    Attempts to lookup a variable in the current scope.

    source

    pub fn lookup_scope_by_index(&self, index: usize) -> Option<&RefCell<Self>>

    Returns the scope associated with index, if it exists in the symbol table.

    -
    source

    pub fn to_json_string(&self) -> Result<String>

    Serializes the symbol table into a JSON string.

    -
    source

    pub fn to_json_value(&self) -> Result<Value>

    Converts the symbol table into a JSON value

    -
    source

    pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>

    source

    pub fn to_json_file_without_keys( +

    source

    pub fn to_json_string(&self) -> Result<String>

    Serializes the symbol table into a JSON string.

    +
    source

    pub fn to_json_value(&self) -> Result<Value>

    Converts the symbol table into a JSON value

    +
    source

    pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>

    source

    pub fn to_json_file_without_keys( &self, path: PathBuf, file_name: &str, excluded_keys: &[&str] -) -> Result<()>

    Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

    -
    source

    pub fn from_json_string(json: &str) -> Result<Self>

    Deserializes the JSON string into a symbol table.

    -
    source

    pub fn from_json_file(path: PathBuf) -> Result<Self>

    Deserializes the JSON string into a symbol table from a file.

    +) -> Result<()>

    Serializes the symbol table into a JSON value and removes keys from object mappings before writing to a file.

    +
    source

    pub fn from_json_string(json: &str) -> Result<Self>

    Deserializes the JSON string into a symbol table.

    +
    source

    pub fn from_json_file(path: PathBuf) -> Result<Self>

    Deserializes the JSON string into a symbol table from a file.

    Trait Implementations§

    source§

    impl Clone for SymbolTable

    source§

    fn clone(&self) -> SymbolTable

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for SymbolTable

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Default for SymbolTable

    source§

    fn default() -> SymbolTable

    Returns the “default value” for a type. Read more
    source§

    impl<'de> Deserialize<'de> for SymbolTable

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl PartialEq for SymbolTable

    source§

    fn eq(&self, other: &SymbolTable) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always diff --git a/leo_passes/common/symbol_table/variable_symbol/struct.VariableSymbol.html b/leo_passes/common/symbol_table/variable_symbol/struct.VariableSymbol.html index 90d0928009..f5f24db133 100644 --- a/leo_passes/common/symbol_table/variable_symbol/struct.VariableSymbol.html +++ b/leo_passes/common/symbol_table/variable_symbol/struct.VariableSymbol.html @@ -1,10 +1,10 @@ VariableSymbol in leo_passes::common::symbol_table::variable_symbol - Rust
    pub struct VariableSymbol {
         pub type_: Type,
    -    pub span: Span,
    +    pub span: Span,
         pub declaration: VariableType,
     }
    Expand description

    An entry for a variable in the symbol table.

    Fields§

    §type_: Type

    The Type of the variable.

    -
    §span: Span

    The Span associated with the variable.

    +
    §span: Span

    The Span associated with the variable.

    §declaration: VariableType

    The type of declaration for the variable.

    Trait Implementations§

    source§

    impl Clone for VariableSymbol

    source§

    fn clone(&self) -> VariableSymbol

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for VariableSymbol

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for VariableSymbol

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for VariableSymbol

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl PartialEq for VariableSymbol

    source§

    fn eq(&self, other: &VariableSymbol) -> bool

    This method tests for self and other values to be equal, and is used diff --git a/leo_passes/common/tree_node/trait.Node.html b/leo_passes/common/tree_node/trait.Node.html index d081f8d397..f027718b38 100644 --- a/leo_passes/common/tree_node/trait.Node.html +++ b/leo_passes/common/tree_node/trait.Node.html @@ -1,2 +1,2 @@ Node in leo_passes::common::tree_node - Rust

    Trait leo_passes::common::tree_node::Node

    source ·
    pub trait Node: Copy + 'static + Eq + PartialEq + Debug + Hash { }
    Expand description

    A node in a graph.

    -

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl Node for Symbol

    Implementors§

    \ No newline at end of file +

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl Node for Symbol

    Implementors§

    \ No newline at end of file diff --git a/leo_passes/common/tree_node/type.ConditionalTreeNode.html b/leo_passes/common/tree_node/type.ConditionalTreeNode.html index bd31d4edbf..a55a8582ed 100644 --- a/leo_passes/common/tree_node/type.ConditionalTreeNode.html +++ b/leo_passes/common/tree_node/type.ConditionalTreeNode.html @@ -1,9 +1,9 @@ -ConditionalTreeNode in leo_passes::common::tree_node - Rust

    Type Alias leo_passes::common::tree_node::ConditionalTreeNode

    source ·
    pub type ConditionalTreeNode = TreeNode<Symbol>;
    Expand description

    A binary search tree to store all paths through nested conditional blocks.

    +ConditionalTreeNode in leo_passes::common::tree_node - Rust

    Type Alias leo_passes::common::tree_node::ConditionalTreeNode

    source ·
    pub type ConditionalTreeNode = TreeNode<Symbol>;
    Expand description

    A binary search tree to store all paths through nested conditional blocks.

    Aliased Type§

    struct ConditionalTreeNode {
         pub depth: usize,
    -    pub elements: IndexSet<Symbol>,
    +    pub elements: IndexSet<Symbol>,
         pub counter: usize,
     }

    Fields§

    §depth: usize

    The current depth.

    -
    §elements: IndexSet<Symbol>

    The current node.

    +
    §elements: IndexSet<Symbol>

    The current node.

    §counter: usize

    A counter.

    \ No newline at end of file diff --git a/leo_passes/dead_code_elimination/dead_code_eliminator/struct.DeadCodeEliminator.html b/leo_passes/dead_code_elimination/dead_code_eliminator/struct.DeadCodeEliminator.html index 309dc10bf1..d181e499f8 100644 --- a/leo_passes/dead_code_elimination/dead_code_eliminator/struct.DeadCodeEliminator.html +++ b/leo_passes/dead_code_elimination/dead_code_eliminator/struct.DeadCodeEliminator.html @@ -1,10 +1,10 @@ DeadCodeEliminator in leo_passes::dead_code_elimination::dead_code_eliminator - Rust
    pub struct DeadCodeEliminator<'a> {
         pub(crate) node_builder: &'a NodeBuilder,
    -    pub(crate) used_variables: IndexSet<Symbol>,
    +    pub(crate) used_variables: IndexSet<Symbol>,
         pub(crate) is_necessary: bool,
         pub(crate) is_async: bool,
     }

    Fields§

    §node_builder: &'a NodeBuilder

    A counter to generate unique node IDs.

    -
    §used_variables: IndexSet<Symbol>

    The set of used variables in the current function body.

    +
    §used_variables: IndexSet<Symbol>

    The set of used variables in the current function body.

    §is_necessary: bool

    Whether or not the variables are necessary.

    §is_async: bool

    Whether or not we are currently traversing an async function.

    Implementations§

    source§

    impl<'a> DeadCodeEliminator<'a>

    source

    pub fn new(node_builder: &'a NodeBuilder) -> Self

    Initializes a new DeadCodeEliminator.

    @@ -73,7 +73,7 @@ ) -> (Expression, Self::AdditionalOutput)
    source§

    fn reconstruct_unit( &mut self, input: UnitExpression -) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for DeadCodeEliminator<'a>

    §

    type Input = (Ast, &'a NodeBuilder)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, node_builder): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for DeadCodeEliminator<'_>

    source§

    impl StatementReconstructor for DeadCodeEliminator<'_>

    source§

    impl<'a> Pass for DeadCodeEliminator<'a>

    §

    type Input = (Ast, &'a NodeBuilder)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, node_builder): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for DeadCodeEliminator<'_>

    source§

    impl StatementReconstructor for DeadCodeEliminator<'_>

    source§

    fn reconstruct_assign( &mut self, input: AssignStatement ) -> (Statement, Self::AdditionalOutput)

    Reconstruct an assignment statement by eliminating any dead code.

    diff --git a/leo_passes/destructuring/destructurer/struct.Destructurer.html b/leo_passes/destructuring/destructurer/struct.Destructurer.html index b6ad1fa9dd..374904778b 100644 --- a/leo_passes/destructuring/destructurer/struct.Destructurer.html +++ b/leo_passes/destructuring/destructurer/struct.Destructurer.html @@ -2,12 +2,12 @@ pub(crate) type_table: &'a TypeTable, pub(crate) node_builder: &'a NodeBuilder, pub(crate) assigner: &'a Assigner, - pub(crate) tuples: IndexMap<Symbol, TupleExpression>, + pub(crate) tuples: IndexMap<Symbol, TupleExpression>, pub(crate) is_async: bool, }

    Fields§

    §type_table: &'a TypeTable

    A mapping between node IDs and their types.

    §node_builder: &'a NodeBuilder

    A counter used to generate unique node IDs.

    §assigner: &'a Assigner

    A struct used to construct (unique) assignment statements.

    -
    §tuples: IndexMap<Symbol, TupleExpression>

    A mapping between variables and flattened tuple expressions.

    +
    §tuples: IndexMap<Symbol, TupleExpression>

    A mapping between variables and flattened tuple expressions.

    §is_async: bool

    Whether or not we are currently traversing an async function block.

    Implementations§

    source§

    impl<'a> Destructurer<'a>

    source

    pub(crate) fn new( type_table: &'a TypeTable, @@ -79,7 +79,7 @@ ) -> (Expression, Self::AdditionalOutput)

    source§

    fn reconstruct_unit( &mut self, input: UnitExpression -) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for Destructurer<'a>

    §

    type Input = (Ast, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, tt, node_builder, assigner): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Destructurer<'_>

    source§

    impl StatementReconstructor for Destructurer<'_>

    source§

    impl<'a> Pass for Destructurer<'a>

    §

    type Input = (Ast, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, tt, node_builder, assigner): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Destructurer<'_>

    source§

    impl StatementReconstructor for Destructurer<'_>

    source§

    fn reconstruct_assign( &mut self, assign: AssignStatement ) -> (Statement, Self::AdditionalOutput)

    Flattens an assign statement, if necessary. diff --git a/leo_passes/flattening/flattener/struct.Flattener.html b/leo_passes/flattening/flattener/struct.Flattener.html index 0645c0c27b..735b26c9c3 100644 --- a/leo_passes/flattening/flattener/struct.Flattener.html +++ b/leo_passes/flattening/flattener/struct.Flattener.html @@ -5,7 +5,7 @@ pub(crate) assigner: &'a Assigner, pub(crate) condition_stack: Vec<Expression>, pub(crate) returns: Vec<(Option<Expression>, ReturnStatement)>, - pub(crate) program: Option<Symbol>, + pub(crate) program: Option<Symbol>, pub(crate) is_async: bool, }

    Fields§

    §symbol_table: &'a SymbolTable

    The symbol table associated with the program.

    §type_table: &'a TypeTable

    A mapping between node IDs and their types.

    @@ -16,7 +16,7 @@ A guard is an expression that evaluates to true on the execution path of the ReturnStatement. Note that returns are inserted in the order they are encountered during a pre-order traversal of the AST. Note that type checking guarantees that there is at most one return in a basic block.

    -
    §program: Option<Symbol>

    The program name.

    +
    §program: Option<Symbol>

    The program name.

    §is_async: bool

    Whether the function is an async function.

    Implementations§

    source§

    impl<'a> Flattener<'a>

    source

    pub(crate) fn new( symbol_table: &'a SymbolTable, @@ -138,7 +138,7 @@ ) -> (Expression, Self::AdditionalOutput)

    source§

    fn reconstruct_unit( &mut self, input: UnitExpression -) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for Flattener<'a>

    §

    type Input = (Ast, &'a SymbolTable, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, st, tt, node_builder, assigner): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Flattener<'_>

    source§

    fn reconstruct_program_scope(&mut self, input: ProgramScope) -> ProgramScope

    Flattens a program scope.

    +) -> (Expression, Self::AdditionalOutput)
    source§

    impl<'a> Pass for Flattener<'a>

    §

    type Input = (Ast, &'a SymbolTable, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass((ast, st, tt, node_builder, assigner): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Flattener<'_>

    source§

    fn reconstruct_program_scope(&mut self, input: ProgramScope) -> ProgramScope

    Flattens a program scope.

    source§

    fn reconstruct_function(&mut self, function: Function) -> Function

    Flattens a function’s body

    source§

    fn reconstruct_program(&mut self, input: Program) -> Program

    source§

    fn reconstruct_stub(&mut self, input: Stub) -> Stub

    source§

    fn reconstruct_function_stub(&mut self, input: FunctionStub) -> FunctionStub

    source§

    fn reconstruct_struct(&mut self, input: Composite) -> Composite

    source§

    fn reconstruct_import(&mut self, input: Program) -> Program

    source§

    fn reconstruct_mapping(&mut self, input: Mapping) -> Mapping

    source§

    impl StatementReconstructor for Flattener<'_>

    source§

    fn reconstruct_assert( &mut self, diff --git a/leo_passes/function_inlining/assignment_renamer/struct.AssignmentRenamer.html b/leo_passes/function_inlining/assignment_renamer/struct.AssignmentRenamer.html index 967b4927f9..9c282dae6c 100644 --- a/leo_passes/function_inlining/assignment_renamer/struct.AssignmentRenamer.html +++ b/leo_passes/function_inlining/assignment_renamer/struct.AssignmentRenamer.html @@ -5,7 +5,7 @@ }
    Expand description

    An AssignmentRenamer renames the left-hand side of all assignment statements in an AST node. The new names are propagated to all following identifiers.

    Fields§

    §assigner: &'a Assigner§rename_table: RenameTable§is_lhs: bool

    Implementations§

    source§

    impl<'a> AssignmentRenamer<'a>

    source

    pub fn new(assigner: &'a Assigner) -> Self

    Initialize a new AssignmentRenamer.

    -
    source

    pub fn load(&mut self, entries: impl Iterator<Item = (Symbol, Symbol, NodeID)>)

    Load the internal rename table with a set of entries.

    +
    source

    pub fn load(&mut self, entries: impl Iterator<Item = (Symbol, Symbol, NodeID)>)

    Load the internal rename table with a set of entries.

    source

    pub fn clear(&mut self)

    Clear the internal rename table.

    Trait Implementations§

    source§

    impl ExpressionReconstructor for AssignmentRenamer<'_>

    source§

    fn reconstruct_identifier( &mut self, diff --git a/leo_passes/function_inlining/function_inliner/struct.FunctionInliner.html b/leo_passes/function_inlining/function_inliner/struct.FunctionInliner.html index 6262def179..a55c113c0d 100644 --- a/leo_passes/function_inlining/function_inliner/struct.FunctionInliner.html +++ b/leo_passes/function_inlining/function_inliner/struct.FunctionInliner.html @@ -3,15 +3,15 @@ pub(crate) call_graph: &'a CallGraph, pub(crate) assignment_renamer: AssignmentRenamer<'a>, pub(crate) type_table: &'a TypeTable, - pub(crate) reconstructed_functions: Vec<(Symbol, Function)>, - pub(crate) program: Option<Symbol>, + pub(crate) reconstructed_functions: Vec<(Symbol, Function)>, + pub(crate) program: Option<Symbol>, pub(crate) is_async: bool, }

    Fields§

    §node_builder: &'a NodeBuilder

    A counter used to create unique NodeIDs.

    §call_graph: &'a CallGraph

    The call graph for the program.

    §assignment_renamer: AssignmentRenamer<'a>

    A wrapper around an Assigner used to create unique variable assignments.

    §type_table: &'a TypeTable

    A mapping between node IDs and their types.

    -
    §reconstructed_functions: Vec<(Symbol, Function)>

    A map of reconstructed functions in the current program scope.

    -
    §program: Option<Symbol>

    The main program.

    +
    §reconstructed_functions: Vec<(Symbol, Function)>

    A map of reconstructed functions in the current program scope.

    +
    §program: Option<Symbol>

    The main program.

    §is_async: bool

    Whether or not we are currently traversing an async function block.

    Implementations§

    source§

    impl<'a> FunctionInliner<'a>

    source

    pub fn new( node_builder: &'a NodeBuilder, @@ -79,7 +79,7 @@ ) -> (Expression, Self::AdditionalOutput)

    source§

    fn reconstruct_unit( &mut self, input: UnitExpression -) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for FunctionInliner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a DiGraph<Symbol>, &'a Assigner, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass( +) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for FunctionInliner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a DiGraph<Symbol>, &'a Assigner, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass( (ast, node_builder, call_graph, assigner, tt): Self::Input ) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for FunctionInliner<'_>

    source§

    impl StatementReconstructor for FunctionInliner<'_>

    source§

    fn reconstruct_assign( &mut self, diff --git a/leo_passes/loop_unrolling/range_iterator/trait.LoopBound.html b/leo_passes/loop_unrolling/range_iterator/trait.LoopBound.html index fc85234679..67584bb569 100644 --- a/leo_passes/loop_unrolling/range_iterator/trait.LoopBound.html +++ b/leo_passes/loop_unrolling/range_iterator/trait.LoopBound.html @@ -1,2 +1,2 @@ -LoopBound in leo_passes::loop_unrolling::range_iterator - Rust
    pub(crate) trait LoopBound: Add<Output = Self> + Copy + Display + One + PartialOrd + TryFrom<Value, Error = LeoError> { }
    Expand description

    A trait for whose implementors are concrete values for loop bounds.

    +LoopBound in leo_passes::loop_unrolling::range_iterator - Rust
    pub(crate) trait LoopBound: Add<Output = Self> + Copy + Display + One + PartialOrd + TryFrom<Value, Error = LeoError> { }
    Expand description

    A trait for whose implementors are concrete values for loop bounds.

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl LoopBound for i128

    source§

    impl LoopBound for u128

    Implementors§

    \ No newline at end of file diff --git a/leo_passes/loop_unrolling/unroller/struct.Unroller.html b/leo_passes/loop_unrolling/unroller/struct.Unroller.html index dd51134860..d948fe47e9 100644 --- a/leo_passes/loop_unrolling/unroller/struct.Unroller.html +++ b/leo_passes/loop_unrolling/unroller/struct.Unroller.html @@ -3,28 +3,28 @@ pub(crate) symbol_table: RefCell<SymbolTable>, pub(crate) type_table: &'a TypeTable, pub(crate) scope_index: usize, - pub(crate) handler: &'a Handler, + pub(crate) handler: &'a Handler, pub(crate) node_builder: &'a NodeBuilder, pub(crate) is_unrolling: bool, - pub(crate) current_program: Option<Symbol>, + pub(crate) current_program: Option<Symbol>, }

    Fields§

    §constant_propagation_table: RefCell<ConstantPropagationTable>

    A table of constant variables.

    §symbol_table: RefCell<SymbolTable>

    The symbol table for the function being processed.

    §type_table: &'a TypeTable

    A mapping from node IDs to their types.

    §scope_index: usize

    The index of the current scope.

    -
    §handler: &'a Handler

    An error handler used for any errors found during unrolling.

    +
    §handler: &'a Handler

    An error handler used for any errors found during unrolling.

    §node_builder: &'a NodeBuilder

    A counter used to generate unique node IDs.

    §is_unrolling: bool

    Are we in the midst of unrolling a loop?

    -
    §current_program: Option<Symbol>

    The current program name.

    +
    §current_program: Option<Symbol>

    The current program name.

    Implementations§

    source§

    impl<'a> Unroller<'a>

    source

    pub(crate) fn new( symbol_table: SymbolTable, type_table: &'a TypeTable, - handler: &'a Handler, + handler: &'a Handler, node_builder: &'a NodeBuilder ) -> Self

    source

    pub(crate) fn current_scope_index(&mut self) -> usize

    Returns the index of the current scope. Note that if we are in the midst of unrolling an IterationStatement, a new scope is created.

    source

    pub(crate) fn enter_scope(&mut self, index: usize) -> usize

    Enters a child scope.

    source

    pub(crate) fn exit_scope(&mut self, index: usize)

    Exits the current block scope.

    -
    source

    pub(crate) fn emit_err(&self, err: LoopUnrollerError)

    Emits a Loop Unrolling Error

    +
    source

    pub(crate) fn emit_err(&self, err: LoopUnrollerError)

    Emits a Loop Unrolling Error

    source

    pub(crate) fn unroll_iteration_statement<I: LoopBound>( &mut self, input: IterationStatement @@ -94,7 +94,7 @@ ) -> (Expression, Self::AdditionalOutput)

    source§

    fn reconstruct_unit( &mut self, input: UnitExpression -) -> (Expression, Self::AdditionalOutput)

    source§

    impl<'a> Pass for Unroller<'a>

    §

    type Input = (Ast, &'a Handler, &'a NodeBuilder, SymbolTable, &'a TypeTable)

    §

    type Output = Result<(Ast, SymbolTable), LeoError>

    source§

    fn do_pass((ast, handler, node_builder, st, tt): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Unroller<'_>

    source§

    impl StatementReconstructor for Unroller<'_>

    source§

    impl<'a> Pass for Unroller<'a>

    §

    type Input = (Ast, &'a Handler, &'a NodeBuilder, SymbolTable, &'a TypeTable)

    §

    type Output = Result<(Ast, SymbolTable), LeoError>

    source§

    fn do_pass((ast, handler, node_builder, st, tt): Self::Input) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramReconstructor for Unroller<'_>

    source§

    impl StatementReconstructor for Unroller<'_>

    source§

    fn reconstruct_block(&mut self, input: Block) -> (Block, Self::AdditionalOutput)

    source§

    fn reconstruct_const( &mut self, input: ConstDeclaration ) -> (Statement, Self::AdditionalOutput)

    source§

    fn reconstruct_definition( diff --git a/leo_passes/pass/trait.Pass.html b/leo_passes/pass/trait.Pass.html index ba7d0ada4b..726a4f8e72 100644 --- a/leo_passes/pass/trait.Pass.html +++ b/leo_passes/pass/trait.Pass.html @@ -6,4 +6,4 @@ fn do_pass(input: Self::Input) -> Self::Output; }
    Expand description

    A compiler pass consuming Self::Input and returning Self::Output.

    Required Associated Types§

    Required Methods§

    source

    fn do_pass(input: Self::Input) -> Self::Output

    Runs the compiler pass.

    -

    Object Safety§

    This trait is not object safe.

    Implementors§

    source§

    impl<'a> Pass for CodeGenerator<'a>

    §

    type Input = (&'a Ast, &'a SymbolTable, &'a TypeTable, &'a DiGraph<Symbol>, &'a DiGraph<Symbol>, &'a Program)

    §

    type Output = Result<String, LeoError>

    source§

    impl<'a> Pass for DeadCodeEliminator<'a>

    §

    type Input = (Ast, &'a NodeBuilder)

    §

    type Output = Result<Ast, LeoError>

    source§

    impl<'a> Pass for Destructurer<'a>

    §

    type Input = (Ast, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    impl<'a> Pass for Flattener<'a>

    §

    type Input = (Ast, &'a SymbolTable, &'a TypeTable, &'a NodeBuilder, &'a Assigner)

    §

    type Output = Result<Ast, LeoError>

    source§

    impl<'a> Pass for FunctionInliner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a DiGraph<Symbol>, &'a Assigner, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    impl<'a> Pass for Unroller<'a>

    §

    type Input = (Ast, &'a Handler, &'a NodeBuilder, SymbolTable, &'a TypeTable)

    §

    type Output = Result<(Ast, SymbolTable), LeoError>

    source§

    impl<'a> Pass for StaticSingleAssigner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a Assigner, &'a SymbolTable, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    impl<'a> Pass for SymbolTableCreator<'a>

    §

    type Input = (&'a Ast, &'a Handler)

    §

    type Output = Result<SymbolTable, LeoError>

    source§

    impl<'a, N: Network> Pass for TypeChecker<'a, N>

    §

    type Input = (&'a Ast, &'a Handler, SymbolTable, &'a TypeTable, usize, bool)

    §

    type Output = Result<(SymbolTable, DiGraph<Symbol>, DiGraph<Symbol>), LeoError>

    \ No newline at end of file +

    Object Safety§

    This trait is not object safe.

    Implementors§

    \ No newline at end of file diff --git a/leo_passes/static_single_assignment/static_single_assigner/struct.StaticSingleAssigner.html b/leo_passes/static_single_assignment/static_single_assigner/struct.StaticSingleAssigner.html index 2a4087d93e..e808124f34 100644 --- a/leo_passes/static_single_assignment/static_single_assigner/struct.StaticSingleAssigner.html +++ b/leo_passes/static_single_assignment/static_single_assigner/struct.StaticSingleAssigner.html @@ -5,14 +5,14 @@ pub(crate) rename_table: RenameTable, pub(crate) is_lhs: bool, pub(crate) assigner: &'a Assigner, - pub(crate) program: Option<Symbol>, + pub(crate) program: Option<Symbol>, }

    Fields§

    §node_builder: &'a NodeBuilder

    A counter used to generate unique node IDs.

    §symbol_table: &'a SymbolTable

    The SymbolTable of the program.

    §type_table: &'a TypeTable

    A mapping from node IDs to their types.

    §rename_table: RenameTable

    The RenameTable for the current basic block in the AST

    §is_lhs: bool

    A flag to determine whether or not the traversal is on the left-hand side of a definition or an assignment.

    §assigner: &'a Assigner

    A struct used to construct (unique) assignment statements.

    -
    §program: Option<Symbol>

    The main program name.

    +
    §program: Option<Symbol>

    The main program name.

    Implementations§

    source§

    impl<'a> StaticSingleAssigner<'a>

    source

    pub(crate) fn new( node_builder: &'a NodeBuilder, symbol_table: &'a SymbolTable, @@ -44,7 +44,7 @@

    source§

    fn consume_tuple(&mut self, input: TupleExpression) -> Self::Output

    Consumes a tuple expression, accumulating any statements that are generated

    source§

    fn consume_unary(&mut self, input: UnaryExpression) -> Self::Output

    Consumes a unary expression, accumulating any statements that are generated.

    §

    type Output = (Expression, Vec<Statement>)

    source§

    fn consume_unit(&mut self, input: UnitExpression) -> Self::Output

    source§

    fn consume_expression(&mut self, input: Expression) -> Self::Output

    source§

    fn consume_err(&mut self, _input: ErrExpression) -> Self::Output

    source§

    impl FunctionConsumer for StaticSingleAssigner<'_>

    source§

    fn consume_function(&mut self, function: Function) -> Self::Output

    Reconstructs the Functions in the Program, while allocating the appropriate RenameTables.

    -
    §

    type Output = Function

    source§

    impl<'a> Pass for StaticSingleAssigner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a Assigner, &'a SymbolTable, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass( +

    §

    type Output = Function

    source§

    impl<'a> Pass for StaticSingleAssigner<'a>

    §

    type Input = (Ast, &'a NodeBuilder, &'a Assigner, &'a SymbolTable, &'a TypeTable)

    §

    type Output = Result<Ast, LeoError>

    source§

    fn do_pass( (ast, node_builder, assigner, symbol_table, type_table): Self::Input ) -> Self::Output

    Runs the compiler pass.
    source§

    impl ProgramConsumer for StaticSingleAssigner<'_>

    §

    type Output = Program

    source§

    fn consume_program(&mut self, input: Program) -> Self::Output

    source§

    impl ProgramScopeConsumer for StaticSingleAssigner<'_>

    source§

    impl StatementConsumer for StaticSingleAssigner<'_>

    source§

    fn consume_assert(&mut self, input: AssertStatement) -> Self::Output

    Consumes the expressions in an AssertStatement, returning the list of simplified statements.

    source§

    fn consume_assign(&mut self, assign: AssignStatement) -> Self::Output

    Consume all AssignStatements, renaming as necessary.

    diff --git a/leo_passes/symbol_table_creation/creator/struct.SymbolTableCreator.html b/leo_passes/symbol_table_creation/creator/struct.SymbolTableCreator.html index 43a94575eb..479d9a9dc4 100644 --- a/leo_passes/symbol_table_creation/creator/struct.SymbolTableCreator.html +++ b/leo_passes/symbol_table_creation/creator/struct.SymbolTableCreator.html @@ -1,18 +1,18 @@ SymbolTableCreator in leo_passes::symbol_table_creation::creator - Rust
    pub struct SymbolTableCreator<'a> {
         pub(crate) symbol_table: SymbolTable,
    -    handler: &'a Handler,
    -    program_name: Option<Symbol>,
    +    handler: &'a Handler,
    +    program_name: Option<Symbol>,
         is_stub: bool,
    -    structs: IndexSet<Symbol>,
    +    structs: IndexSet<Symbol>,
     }
    Expand description

    A compiler pass during which the SymbolTable is created. Note that this pass only creates the initial entries for functions, structs, and records. The table is populated further during the type checking pass.

    Fields§

    §symbol_table: SymbolTable

    The SymbolTable constructed by this compiler pass.

    -
    §handler: &'a Handler

    The error handler.

    -
    §program_name: Option<Symbol>

    The current program name.

    +
    §handler: &'a Handler

    The error handler.

    +
    §program_name: Option<Symbol>

    The current program name.

    §is_stub: bool

    Whether or not traversing stub.

    -
    §structs: IndexSet<Symbol>

    The set of local structs that have been successfully visited.

    -

    Implementations§

    source§

    impl<'a> SymbolTableCreator<'a>

    source

    pub fn new(handler: &'a Handler) -> Self

    Trait Implementations§

    source§

    impl<'a> ExpressionVisitor<'a> for SymbolTableCreator<'a>

    §structs: IndexSet<Symbol>

    The set of local structs that have been successfully visited.

    +

    Implementations§

    source§

    impl<'a> SymbolTableCreator<'a>

    source

    pub fn new(handler: &'a Handler) -> Self

    Trait Implementations§

    source§

    impl<'a> ExpressionVisitor<'a> for SymbolTableCreator<'a>

    §

    type AdditionalInput = ()

    §

    type Output = ()

    source§

    fn visit_expression( &mut self, input: &'a Expression, additional: &Self::AdditionalInput @@ -73,7 +73,7 @@ _input: &'a UnitExpression, _additional: &Self::AdditionalInput ) -> Self::Output

    source§

    impl<'a> Pass for SymbolTableCreator<'a>

    source§

    fn do_pass((ast, handler): Self::Input) -> Self::Output

    Runs the compiler pass.

    -
    §

    type Input = (&'a Ast, &'a Handler)

    §

    type Output = Result<SymbolTable, LeoError>

    source§

    impl<'a> ProgramVisitor<'a> for SymbolTableCreator<'a>

    source§

    fn visit_program_scope(&mut self, input: &'a ProgramScope)

    source§

    fn visit_import(&mut self, input: &'a Program)

    source§

    fn visit_struct(&mut self, input: &'a Composite)

    source§

    fn visit_mapping(&mut self, input: &'a Mapping)

    source§

    fn visit_function(&mut self, input: &'a Function)

    source§

    fn visit_stub(&mut self, input: &'a Stub)

    source§

    fn visit_function_stub(&mut self, input: &'a FunctionStub)

    source§

    fn visit_struct_stub(&mut self, input: &'a Composite)

    source§

    fn visit_program(&mut self, input: &'a Program)

    source§

    impl<'a> StatementVisitor<'a> for SymbolTableCreator<'a>

    source§

    fn visit_statement(&mut self, input: &'a Statement)

    source§

    fn visit_assert(&mut self, input: &'a AssertStatement)

    source§

    fn visit_assign(&mut self, input: &'a AssignStatement)

    source§

    fn visit_block(&mut self, input: &'a Block)

    source§

    fn visit_conditional(&mut self, input: &'a ConditionalStatement)

    source§

    fn visit_console(&mut self, input: &'a ConsoleStatement)

    source§

    fn visit_const(&mut self, input: &'a ConstDeclaration)

    source§

    fn visit_definition(&mut self, input: &'a DefinitionStatement)

    source§

    fn visit_expression_statement(&mut self, input: &'a ExpressionStatement)

    source§

    fn visit_iteration(&mut self, input: &'a IterationStatement)

    source§

    fn visit_return(&mut self, input: &'a ReturnStatement)

    Auto Trait Implementations§

    §

    impl<'a> Freeze for SymbolTableCreator<'a>

    §

    impl<'a> !RefUnwindSafe for SymbolTableCreator<'a>

    §

    impl<'a> !Send for SymbolTableCreator<'a>

    §

    impl<'a> !Sync for SymbolTableCreator<'a>

    §

    impl<'a> Unpin for SymbolTableCreator<'a>

    §

    impl<'a> !UnwindSafe for SymbolTableCreator<'a>

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +

    §

    type Input = (&'a Ast, &'a Handler)

    §

    type Output = Result<SymbolTable, LeoError>

    source§

    impl<'a> ProgramVisitor<'a> for SymbolTableCreator<'a>

    source§

    fn visit_program_scope(&mut self, input: &'a ProgramScope)

    source§

    fn visit_import(&mut self, input: &'a Program)

    source§

    fn visit_struct(&mut self, input: &'a Composite)

    source§

    fn visit_mapping(&mut self, input: &'a Mapping)

    source§

    fn visit_function(&mut self, input: &'a Function)

    source§

    fn visit_stub(&mut self, input: &'a Stub)

    source§

    fn visit_function_stub(&mut self, input: &'a FunctionStub)

    source§

    fn visit_struct_stub(&mut self, input: &'a Composite)

    source§

    fn visit_program(&mut self, input: &'a Program)

    source§

    impl<'a> StatementVisitor<'a> for SymbolTableCreator<'a>

    source§

    fn visit_statement(&mut self, input: &'a Statement)

    source§

    fn visit_assert(&mut self, input: &'a AssertStatement)

    source§

    fn visit_assign(&mut self, input: &'a AssignStatement)

    source§

    fn visit_block(&mut self, input: &'a Block)

    source§

    fn visit_conditional(&mut self, input: &'a ConditionalStatement)

    source§

    fn visit_console(&mut self, input: &'a ConsoleStatement)

    source§

    fn visit_const(&mut self, input: &'a ConstDeclaration)

    source§

    fn visit_definition(&mut self, input: &'a DefinitionStatement)

    source§

    fn visit_expression_statement(&mut self, input: &'a ExpressionStatement)

    source§

    fn visit_iteration(&mut self, input: &'a IterationStatement)

    source§

    fn visit_return(&mut self, input: &'a ReturnStatement)

    Auto Trait Implementations§

    §

    impl<'a> Freeze for SymbolTableCreator<'a>

    §

    impl<'a> !RefUnwindSafe for SymbolTableCreator<'a>

    §

    impl<'a> !Send for SymbolTableCreator<'a>

    §

    impl<'a> !Sync for SymbolTableCreator<'a>

    §

    impl<'a> Unpin for SymbolTableCreator<'a>

    §

    impl<'a> !UnwindSafe for SymbolTableCreator<'a>

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/leo_passes/type_checking/await_checker/struct.AwaitChecker.html b/leo_passes/type_checking/await_checker/struct.AwaitChecker.html index fe6e6125b1..19e9b61e53 100644 --- a/leo_passes/type_checking/await_checker/struct.AwaitChecker.html +++ b/leo_passes/type_checking/await_checker/struct.AwaitChecker.html @@ -1,20 +1,20 @@ AwaitChecker in leo_passes::type_checking::await_checker - Rust

    Struct leo_passes::type_checking::await_checker::AwaitChecker

    source ·
    pub struct AwaitChecker {
         pub(crate) to_await: Vec<ConditionalTreeNode>,
    -    pub(crate) static_to_await: IndexSet<Symbol>,
    +    pub(crate) static_to_await: IndexSet<Symbol>,
         pub(crate) enabled: bool,
         pub(crate) max_depth: usize,
     }

    Fields§

    §to_await: Vec<ConditionalTreeNode>

    All possible subsets of futures that must be awaited.

    -
    §static_to_await: IndexSet<Symbol>

    Statically updated set of futures to await.

    +
    §static_to_await: IndexSet<Symbol>

    Statically updated set of futures to await.

    §enabled: bool

    Whether or not to do full tree search for await checking.

    §max_depth: usize

    Maximum nesting depth to search for await checking.

    Implementations§

    source§

    impl AwaitChecker

    source

    pub fn new(max_depth: usize, enabled: bool) -> Self

    Initializes a new AwaitChecker.

    source

    pub fn remove(&mut self, id: &Identifier)

    Remove from list.

    -
    source

    pub fn set_futures(&mut self, futures: IndexSet<Symbol>)

    Initialize futures.

    +
    source

    pub fn set_futures(&mut self, futures: IndexSet<Symbol>)

    Initialize futures.

    source

    pub fn create_then_scope( &mut self, is_finalize: bool, - input: Span -) -> Result<Vec<ConditionalTreeNode>, TypeCheckerWarning>

    Enter scope for then branch of conditional.

    + input: Span +) -> Result<Vec<ConditionalTreeNode>, TypeCheckerWarning>

    Enter scope for then branch of conditional.

    source

    pub fn exit_then_scope( &mut self, is_finalize: bool, diff --git a/leo_passes/type_checking/checker/struct.TypeChecker.html b/leo_passes/type_checking/checker/struct.TypeChecker.html index cc59675d3e..d2589ac6da 100644 --- a/leo_passes/type_checking/checker/struct.TypeChecker.html +++ b/leo_passes/type_checking/checker/struct.TypeChecker.html @@ -3,93 +3,93 @@ pub(crate) type_table: &'a TypeTable, pub(crate) struct_graph: StructGraph, pub(crate) call_graph: CallGraph, - pub(crate) handler: &'a Handler, + pub(crate) handler: &'a Handler, pub(crate) scope_state: ScopeState, pub(crate) await_checker: AwaitChecker, pub(crate) async_function_input_types: IndexMap<Location, Vec<Type>>, - pub(crate) used_structs: IndexSet<Symbol>, + pub(crate) used_structs: IndexSet<Symbol>, phantom: PhantomData<N>, }

    Fields§

    §symbol_table: RefCell<SymbolTable>

    The symbol table for the program.

    §type_table: &'a TypeTable

    A mapping from node IDs to their types.

    §struct_graph: StructGraph

    A dependency graph of the structs in program.

    §call_graph: CallGraph

    The call graph for the program.

    -
    §handler: &'a Handler

    The error handler.

    +
    §handler: &'a Handler

    The error handler.

    §scope_state: ScopeState

    The state of the current scope being traversed.

    §await_checker: AwaitChecker

    Struct to store the state relevant to checking all futures are awaited.

    §async_function_input_types: IndexMap<Location, Vec<Type>>

    Mapping from async function name to the inferred input types.

    -
    §used_structs: IndexSet<Symbol>

    The set of used composites.

    +
    §used_structs: IndexSet<Symbol>

    The set of used composites.

    §phantom: PhantomData<N>

    Implementations§

    source§

    impl<'a, N: Network> TypeChecker<'a, N>

    source

    pub fn new( symbol_table: SymbolTable, type_table: &'a TypeTable, - handler: &'a Handler, + handler: &'a Handler, max_depth: usize, disabled: bool ) -> Self

    Returns a new type checker given a symbol table and error handler.

    source

    pub(crate) fn enter_scope(&mut self, index: usize)

    Enters a child scope.

    source

    pub(crate) fn create_child_scope(&mut self) -> usize

    Creates a new child scope.

    source

    pub(crate) fn exit_scope(&mut self, index: usize)

    Exits the current scope.

    -
    source

    pub(crate) fn emit_err(&self, err: TypeCheckerError)

    Emits a type checker error.

    -
    source

    pub fn emit_warning(&self, warning: TypeCheckerWarning)

    Emits a type checker warning

    +
    source

    pub(crate) fn emit_err(&self, err: TypeCheckerError)

    Emits a type checker error.

    +
    source

    pub fn emit_warning(&self, warning: TypeCheckerWarning)

    Emits a type checker warning

    source

    fn check_type( &self, is_valid: impl Fn(&Type) -> bool, error_string: String, type_: &Option<Type>, - span: Span + span: Span )

    Emits an error to the handler if the given type is invalid.

    source

    pub(crate) fn check_eq_types( &self, t1: &Option<Type>, t2: &Option<Type>, - span: Span + span: Span )

    Emits an error if the two given types are not equal.

    source

    pub(crate) fn assert_and_return_type( &mut self, actual: Type, expected: &Option<Type>, - span: Span + span: Span ) -> Type

    Use this method when you know the actual type. Emits an error to the handler if the actual type is not equal to the expected type.

    source

    pub(crate) fn assert_type( &mut self, actual: &Option<Type>, expected: &Type, - span: Span + span: Span )

    Emits an error to the error handler if the actual type is not equal to the expected type.

    -
    source

    pub(crate) fn assert_address_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the error handler if the given type is not an address.

    -
    source

    pub(crate) fn assert_bool_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a boolean.

    -
    source

    pub(crate) fn assert_field_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field.

    -
    source

    pub(crate) fn assert_group_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a group.

    -
    source

    pub(crate) fn assert_scalar_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a scalar.

    -
    source

    pub(crate) fn assert_signature_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a signature.

    -
    source

    pub(crate) fn assert_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not an integer.

    -
    source

    pub(crate) fn assert_signed_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a signed integer.

    -
    source

    pub(crate) fn assert_unsigned_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not an unsigned integer.

    -
    source

    pub(crate) fn assert_magnitude_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a magnitude (u8, u16, u32).

    -
    source

    pub(crate) fn assert_bool_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a boolean or an integer.

    -
    source

    pub(crate) fn assert_field_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field or integer.

    -
    source

    pub(crate) fn assert_field_group_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field or group.

    +
    source

    pub(crate) fn assert_address_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the error handler if the given type is not an address.

    +
    source

    pub(crate) fn assert_bool_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a boolean.

    +
    source

    pub(crate) fn assert_field_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field.

    +
    source

    pub(crate) fn assert_group_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a group.

    +
    source

    pub(crate) fn assert_scalar_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a scalar.

    +
    source

    pub(crate) fn assert_signature_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a signature.

    +
    source

    pub(crate) fn assert_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not an integer.

    +
    source

    pub(crate) fn assert_signed_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a signed integer.

    +
    source

    pub(crate) fn assert_unsigned_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not an unsigned integer.

    +
    source

    pub(crate) fn assert_magnitude_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a magnitude (u8, u16, u32).

    +
    source

    pub(crate) fn assert_bool_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a boolean or an integer.

    +
    source

    pub(crate) fn assert_field_int_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field or integer.

    +
    source

    pub(crate) fn assert_field_group_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field or group.

    source

    pub(crate) fn assert_field_group_int_type( &self, type_: &Option<Type>, - span: Span + span: Span )

    Emits an error to the handler if the given type is not a field, group, or integer.

    source

    pub(crate) fn assert_field_group_signed_int_type( &self, type_: &Option<Type>, - span: Span + span: Span )

    Emits an error to the handler if the given type is not a field, group, or signed integer.

    source

    pub(crate) fn assert_field_scalar_int_type( &self, type_: &Option<Type>, - span: Span + span: Span )

    Emits an error to the handler if the given type is not a field, scalar, or integer.

    source

    pub(crate) fn assert_field_group_scalar_int_type( &self, type_: &Option<Type>, - span: Span + span: Span )

    Emits an error to the handler if the given type is not a field, group, scalar, integer, or boolean.

    -
    source

    pub(crate) fn assert_castable_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field, group, scalar, integer, boolean, or address.

    +
    source

    pub(crate) fn assert_castable_type(&self, type_: &Option<Type>, span: Span)

    Emits an error to the handler if the given type is not a field, group, scalar, integer, boolean, or address.

    source

    pub(crate) fn get_core_constant( &self, type_: &Type, @@ -104,8 +104,8 @@

    source

    pub(crate) fn check_core_function_call( &mut self, core_function: CoreFunction, - arguments: &[(Option<Type>, Span)], - function_span: Span + arguments: &[(Option<Type>, Span)], + function_span: Span ) -> Option<Type>

    Type checks the inputs to a core function call and returns the expected output type. Emits an error if the correct number of arguments are not provided. Emits an error if the arguments are not of the correct type.

    @@ -113,31 +113,31 @@ &mut self, struct_: &Composite, expected: &Option<Type>, - span: Span + span: Span ) -> Type

    Returns the struct type and emits an error if the expected type does not match.

    source

    pub(crate) fn assert_member_is_not_record( &mut self, - span: Span, - parent: Symbol, + span: Span, + parent: Symbol, type_: &Type )

    Emits an error if the struct member is a record type.

    -
    source

    pub(crate) fn assert_type_is_valid(&mut self, type_: &Type, span: Span) -> bool

    Emits an error if the type or its constituent types is not valid.

    +
    source

    pub(crate) fn assert_type_is_valid(&mut self, type_: &Type, span: Span) -> bool

    Emits an error if the type or its constituent types is not valid.

    source

    pub(crate) fn assert_mapping_type( &self, type_: &Option<Type>, - span: Span + span: Span ) -> Option<MappingType>

    Emits an error if the type is not a mapping.

    -
    source

    pub(crate) fn assert_array_type(&self, type_: &Option<Type>, span: Span)

    Emits an error if the type is not an array.

    +
    source

    pub(crate) fn assert_array_type(&self, type_: &Option<Type>, span: Span)

    Emits an error if the type is not an array.

    source

    pub(crate) fn check_function_signature(&mut self, function: &Function)

    Helper function to check that the input and output of function are valid

    source

    pub(crate) fn lookup_struct( &mut self, - program: Option<Symbol>, - name: Symbol + program: Option<Symbol>, + name: Symbol ) -> Option<Composite>

    Wrapper around lookup_struct that additionally records all structs that are used in the program.

    source

    pub(crate) fn assert_future_await( &mut self, future: &Option<&Expression>, - span: Span + span: Span )

    Type checks the awaiting of a future.

    source

    pub(crate) fn insert_variable( &mut self, @@ -145,13 +145,13 @@ name: &Identifier, type_: Type, index: usize, - span: Span + span: Span )

    Inserts variable to symbol table.

    source

    pub(crate) fn check_access_allowed( &mut self, name: &str, finalize_op: bool, - span: Span + span: Span )

    Trait Implementations§

    source§

    impl<'a, N: Network> ExpressionVisitor<'a> for TypeChecker<'a, N>

    §

    type AdditionalInput = Option<Type>

    §

    type Output = Option<Type>

    source§

    fn visit_expression( &mut self, input: &'a Expression, @@ -212,7 +212,7 @@ &mut self, input: &'a UnitExpression, _additional: &Self::AdditionalInput -) -> Self::Output

    source§

    impl<'a, N: Network> Pass for TypeChecker<'a, N>

    §

    type Input = (&'a Ast, &'a Handler, SymbolTable, &'a TypeTable, usize, bool)

    §

    type Output = Result<(SymbolTable, DiGraph<Symbol>, DiGraph<Symbol>), LeoError>

    source§

    fn do_pass( +) -> Self::Output

    source§

    impl<'a, N: Network> Pass for TypeChecker<'a, N>

    §

    type Input = (&'a Ast, &'a Handler, SymbolTable, &'a TypeTable, usize, bool)

    §

    type Output = Result<(SymbolTable, DiGraph<Symbol>, DiGraph<Symbol>), LeoError>

    source§

    fn do_pass( (ast, handler, st, tt, max_depth, await_checking): Self::Input ) -> Self::Output

    Runs the compiler pass.
    source§

    impl<'a, N: Network> ProgramVisitor<'a> for TypeChecker<'a, N>

    source§

    fn visit_program(&mut self, input: &'a Program)

    source§

    fn visit_program_scope(&mut self, input: &'a ProgramScope)

    source§

    fn visit_stub(&mut self, input: &'a Stub)

    source§

    fn visit_struct(&mut self, input: &'a Composite)

    source§

    fn visit_mapping(&mut self, input: &'a Mapping)

    source§

    fn visit_function(&mut self, function: &'a Function)

    source§

    fn visit_function_stub(&mut self, input: &'a FunctionStub)

    source§

    fn visit_struct_stub(&mut self, input: &'a Composite)

    source§

    fn visit_import(&mut self, input: &'a Program)

    source§

    impl<'a, N: Network> StatementVisitor<'a> for TypeChecker<'a, N>

    source§

    fn visit_statement(&mut self, input: &'a Statement)

    source§

    fn visit_assert(&mut self, input: &'a AssertStatement)

    source§

    fn visit_assign(&mut self, input: &'a AssignStatement)

    source§

    fn visit_block(&mut self, input: &'a Block)

    source§

    fn visit_conditional(&mut self, input: &'a ConditionalStatement)

    source§

    fn visit_console(&mut self, _: &'a ConsoleStatement)

    source§

    fn visit_const(&mut self, input: &'a ConstDeclaration)

    source§

    fn visit_definition(&mut self, input: &'a DefinitionStatement)

    source§

    fn visit_expression_statement(&mut self, input: &'a ExpressionStatement)

    source§

    fn visit_iteration(&mut self, input: &'a IterationStatement)

    source§

    fn visit_return(&mut self, input: &'a ReturnStatement)

    Auto Trait Implementations§

    §

    impl<'a, N> !Freeze for TypeChecker<'a, N>

    §

    impl<'a, N> !RefUnwindSafe for TypeChecker<'a, N>

    §

    impl<'a, N> !Send for TypeChecker<'a, N>

    §

    impl<'a, N> !Sync for TypeChecker<'a, N>

    §

    impl<'a, N> Unpin for TypeChecker<'a, N>
    where N: Unpin,

    §

    impl<'a, N> !UnwindSafe for TypeChecker<'a, N>

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/leo_passes/type_checking/scope_state/struct.ScopeState.html b/leo_passes/type_checking/scope_state/struct.ScopeState.html index c4e0be5d59..4f06b8db51 100644 --- a/leo_passes/type_checking/scope_state/struct.ScopeState.html +++ b/leo_passes/type_checking/scope_state/struct.ScopeState.html @@ -1,22 +1,22 @@ ScopeState in leo_passes::type_checking::scope_state - Rust

    Struct leo_passes::type_checking::scope_state::ScopeState

    source ·
    pub struct ScopeState {
    -    pub(crate) function: Option<Symbol>,
    +    pub(crate) function: Option<Symbol>,
         pub(crate) variant: Option<Variant>,
         pub(crate) has_return: bool,
         pub(crate) is_return: bool,
    -    pub(crate) program_name: Option<Symbol>,
    +    pub(crate) program_name: Option<Symbol>,
         pub(crate) is_stub: bool,
    -    pub(crate) futures: IndexMap<Symbol, Location>,
    +    pub(crate) futures: IndexMap<Symbol, Location>,
         pub(crate) has_called_finalize: bool,
         pub(crate) is_conditional: bool,
         pub(crate) is_call: bool,
         pub(crate) call_location: Option<Location>,
    -}

    Fields§

    §function: Option<Symbol>

    The name of the function that we are currently traversing.

    +}

    Fields§

    §function: Option<Symbol>

    The name of the function that we are currently traversing.

    §variant: Option<Variant>

    The variant of the function that we are currently traversing.

    §has_return: bool

    Whether or not the function that we are currently traversing has a return statement.

    §is_return: bool

    Whether or not we are currently traversing a return statement.

    -
    §program_name: Option<Symbol>

    Current program name.

    +
    §program_name: Option<Symbol>

    Current program name.

    §is_stub: bool

    Whether or not we are currently traversing a stub.

    -
    §futures: IndexMap<Symbol, Location>

    The futures that must be propagated to an async function.

    +
    §futures: IndexMap<Symbol, Location>

    The futures that must be propagated to an async function.

    §has_called_finalize: bool

    Whether the finalize caller has called the finalize function.

    §is_conditional: bool

    Whether currently traversing a conditional statement.

    §is_call: bool

    Whether the current function is a call.

    diff --git a/leo_retriever/program_context/dependency/struct.Dependency.html b/leo_retriever/program_context/dependency/struct.Dependency.html index 569673c25e..c78ab6510f 100644 --- a/leo_retriever/program_context/dependency/struct.Dependency.html +++ b/leo_retriever/program_context/dependency/struct.Dependency.html @@ -9,7 +9,7 @@ network: Option<NetworkName>, path: Option<PathBuf> ) -> Self

    source

    pub fn name(&self) -> &String

    source

    pub fn location(&self) -> &Location

    source

    pub fn network(&self) -> &Option<NetworkName>

    source

    pub fn path(&self) -> &Option<PathBuf>

    Trait Implementations§

    source§

    impl Clone for Dependency

    source§

    fn clone(&self) -> Dependency

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Dependency

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Dependency

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl From<&Dependency> for Symbol

    source§

    fn from(context: &Dependency) -> Self

    Converts to this type from the input type.
    source§

    impl From<Dependency> for ProgramContext

    source§

    fn from(dependency: Dependency) -> Self

    Converts to this type from the input type.
    source§

    impl Hash for Dependency

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl From<&Dependency> for Symbol

    source§

    fn from(context: &Dependency) -> Self

    Converts to this type from the input type.
    source§

    impl From<Dependency> for ProgramContext

    source§

    fn from(dependency: Dependency) -> Self

    Converts to this type from the input type.
    source§

    impl Hash for Dependency

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for Dependency

    source§

    fn eq(&self, other: &Dependency) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always diff --git a/leo_retriever/program_context/manifest/struct.Manifest.html b/leo_retriever/program_context/manifest/struct.Manifest.html index ef9fc9ee76..71972ab074 100644 --- a/leo_retriever/program_context/manifest/struct.Manifest.html +++ b/leo_retriever/program_context/manifest/struct.Manifest.html @@ -10,7 +10,7 @@ description: &str, license: &str, dependencies: Option<Vec<Dependency>> -) -> Self
    source

    pub fn default(program: &str) -> Self

    source

    pub fn program(&self) -> &String

    source

    pub fn version(&self) -> &String

    source

    pub fn description(&self) -> &String

    source

    pub fn license(&self) -> &String

    source

    pub fn dependencies(&self) -> &Option<Vec<Dependency>>

    source

    pub fn write_to_dir(&self, path: &Path) -> Result<(), PackageError>

    source

    pub fn read_from_dir(path: &Path) -> Result<Self, PackageError>

    Trait Implementations§

    source§

    impl Clone for Manifest

    source§

    fn clone(&self) -> Manifest

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Manifest

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Manifest

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where +) -> Self

    source

    pub fn default(program: &str) -> Self

    source

    pub fn program(&self) -> &String

    source

    pub fn version(&self) -> &String

    source

    pub fn description(&self) -> &String

    source

    pub fn license(&self) -> &String

    source

    pub fn dependencies(&self) -> &Option<Vec<Dependency>>

    source

    pub fn write_to_dir(&self, path: &Path) -> Result<(), PackageError>

    source

    pub fn read_from_dir(path: &Path) -> Result<Self, PackageError>

    Trait Implementations§

    source§

    impl Clone for Manifest

    source§

    fn clone(&self) -> Manifest

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Manifest

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Manifest

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Serialize for Manifest

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where diff --git a/leo_retriever/program_context/network_name/enum.NetworkName.html b/leo_retriever/program_context/network_name/enum.NetworkName.html index a35e12c58e..7cc683f1fb 100644 --- a/leo_retriever/program_context/network_name/enum.NetworkName.html +++ b/leo_retriever/program_context/network_name/enum.NetworkName.html @@ -8,7 +8,7 @@ Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    source§

    impl PartialEq for NetworkName

    source§

    fn eq(&self, other: &NetworkName) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    source§

    impl Serialize for NetworkName

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where - __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl TryFrom<&str> for NetworkName

    §

    type Error = LeoError

    The type returned in the event of a conversion error.
    source§

    fn try_from(network: &str) -> Result<Self, LeoError>

    Performs the conversion.
    source§

    impl TryFrom<String> for NetworkName

    §

    type Error = LeoError

    The type returned in the event of a conversion error.
    source§

    fn try_from(network: String) -> Result<Self, LeoError>

    Performs the conversion.
    source§

    impl Copy for NetworkName

    source§

    impl Eq for NetworkName

    source§

    impl StructuralPartialEq for NetworkName

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    source§

    impl TryFrom<&str> for NetworkName

    §

    type Error = LeoError

    The type returned in the event of a conversion error.
    source§

    fn try_from(network: &str) -> Result<Self, LeoError>

    Performs the conversion.
    source§

    impl TryFrom<String> for NetworkName

    §

    type Error = LeoError

    The type returned in the event of a conversion error.
    source§

    fn try_from(network: String) -> Result<Self, LeoError>

    Performs the conversion.
    source§

    impl Copy for NetworkName

    source§

    impl Eq for NetworkName

    source§

    impl StructuralPartialEq for NetworkName

    Auto Trait Implementations§

    §

    impl Freeze for NetworkName

    §

    impl RefUnwindSafe for NetworkName

    §

    impl Send for NetworkName

    §

    impl Sync for NetworkName

    §

    impl Unpin for NetworkName

    §

    impl UnwindSafe for NetworkName

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<'de, T> DeserializeExt<'de> for T
    where diff --git a/leo_retriever/program_context/struct.ProgramContext.html b/leo_retriever/program_context/struct.ProgramContext.html index 91bbae111f..41aafe02a7 100644 --- a/leo_retriever/program_context/struct.ProgramContext.html +++ b/leo_retriever/program_context/struct.ProgramContext.html @@ -1,20 +1,20 @@ ProgramContext in leo_retriever::program_context - Rust

    Struct leo_retriever::program_context::ProgramContext

    source ·
    pub struct ProgramContext {
    -    name: Symbol,
    +    name: Symbol,
         full_name: String,
         location: Location,
         network: Option<NetworkName>,
         path: Option<PathBuf>,
         full_path: Option<PathBuf>,
         compiled_file_path: Option<PathBuf>,
    -    dependencies: Option<Vec<Symbol>>,
    +    dependencies: Option<Vec<Symbol>>,
         checksum: Option<String>,
         stub: Option<Stub>,
    -    post_order: Option<IndexSet<Symbol>>,
    -}

    Fields§

    §name: Symbol§full_name: String§location: Location§network: Option<NetworkName>§path: Option<PathBuf>§full_path: Option<PathBuf>§compiled_file_path: Option<PathBuf>§dependencies: Option<Vec<Symbol>>§checksum: Option<String>§stub: Option<Stub>§post_order: Option<IndexSet<Symbol>>

    Implementations§

    source§

    impl ProgramContext

    source

    pub fn new_main( - name: Symbol, + post_order: Option<IndexSet<Symbol>>, +}

    Fields§

    §name: Symbol§full_name: String§location: Location§network: Option<NetworkName>§path: Option<PathBuf>§full_path: Option<PathBuf>§compiled_file_path: Option<PathBuf>§dependencies: Option<Vec<Symbol>>§checksum: Option<String>§stub: Option<Stub>§post_order: Option<IndexSet<Symbol>>

    Implementations§

    source§

    impl ProgramContext

    source

    pub fn new_main( + name: Symbol, path: PathBuf, dependencies: Vec<Dependency> -) -> Self

    source

    pub fn name(&self) -> &Symbol

    source

    pub fn full_name(&self) -> &String

    source

    pub fn network(&self) -> &NetworkName

    source

    pub fn location(&self) -> &Location

    source

    pub fn path(&self) -> &PathBuf

    source

    pub fn full_path(&self) -> &PathBuf

    source

    pub fn add_full_path(&mut self, full_path: &Path)

    source

    pub fn compiled_file_path(&self) -> &PathBuf

    source

    pub fn add_compiled_file_path(&mut self, path: &Path)

    source

    pub fn checksum(&self) -> &String

    source

    pub fn add_checksum(&mut self)

    source

    pub fn add_stub(&mut self, stub: Stub) -> bool

    source

    pub fn stub(&self) -> &Stub

    source

    pub fn dependencies(&self) -> Vec<Symbol>

    source

    pub fn add_dependencies(&mut self, dependencies: Vec<Symbol>)

    source

    pub fn post_order(&self) -> &IndexSet<Symbol>

    source

    pub fn add_post_order(&mut self, post_order: IndexSet<Symbol>)

    Trait Implementations§

    source§

    impl Clone for ProgramContext

    source§

    fn clone(&self) -> ProgramContext

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for ProgramContext

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl From<&ProgramContext> for LockFileEntry

    source§

    fn from(context: &ProgramContext) -> Self

    Converts to this type from the input type.
    source§

    impl From<Dependency> for ProgramContext

    source§

    fn from(dependency: Dependency) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +) -> Self

    source

    pub fn name(&self) -> &Symbol

    source

    pub fn full_name(&self) -> &String

    source

    pub fn network(&self) -> &NetworkName

    source

    pub fn location(&self) -> &Location

    source

    pub fn path(&self) -> &PathBuf

    source

    pub fn full_path(&self) -> &PathBuf

    source

    pub fn add_full_path(&mut self, full_path: &Path)

    source

    pub fn compiled_file_path(&self) -> &PathBuf

    source

    pub fn add_compiled_file_path(&mut self, path: &Path)

    source

    pub fn checksum(&self) -> &String

    source

    pub fn add_checksum(&mut self)

    source

    pub fn add_stub(&mut self, stub: Stub) -> bool

    source

    pub fn stub(&self) -> &Stub

    source

    pub fn dependencies(&self) -> Vec<Symbol>

    source

    pub fn add_dependencies(&mut self, dependencies: Vec<Symbol>)

    source

    pub fn post_order(&self) -> &IndexSet<Symbol>

    source

    pub fn add_post_order(&mut self, post_order: IndexSet<Symbol>)

    Trait Implementations§

    source§

    impl Clone for ProgramContext

    source§

    fn clone(&self) -> ProgramContext

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for ProgramContext

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl From<&ProgramContext> for LockFileEntry

    source§

    fn from(context: &ProgramContext) -> Self

    Converts to this type from the input type.
    source§

    impl From<Dependency> for ProgramContext

    source§

    fn from(dependency: Dependency) -> Self

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/leo_retriever/retriever/fn.fetch_from_network.html b/leo_retriever/retriever/fn.fetch_from_network.html index 5e2b1adfd4..f79d5fc1c3 100644 --- a/leo_retriever/retriever/fn.fetch_from_network.html +++ b/leo_retriever/retriever/fn.fetch_from_network.html @@ -1 +1 @@ -fetch_from_network in leo_retriever::retriever - Rust

    Function leo_retriever::retriever::fetch_from_network

    source ·
    pub fn fetch_from_network(url: &str) -> Result<String, UtilError>
    \ No newline at end of file +fetch_from_network in leo_retriever::retriever - Rust

    Function leo_retriever::retriever::fetch_from_network

    source ·
    pub fn fetch_from_network(url: &str) -> Result<String, UtilError>
    \ No newline at end of file diff --git a/leo_retriever/retriever/fn.retrieve_from_network.html b/leo_retriever/retriever/fn.retrieve_from_network.html index 88d62b634f..6732fc76ba 100644 --- a/leo_retriever/retriever/fn.retrieve_from_network.html +++ b/leo_retriever/retriever/fn.retrieve_from_network.html @@ -3,4 +3,4 @@ home_path: &Path, name: &String, endpoint: &String -) -> Result<(Stub, Vec<Dependency>), UtilError>
    \ No newline at end of file +) -> Result<(Stub, Vec<Dependency>), UtilError>

    \ No newline at end of file diff --git a/leo_retriever/retriever/fn.retrieve_local.html b/leo_retriever/retriever/fn.retrieve_local.html index 619f383247..4ff3e3b621 100644 --- a/leo_retriever/retriever/fn.retrieve_local.html +++ b/leo_retriever/retriever/fn.retrieve_local.html @@ -1,4 +1,4 @@ retrieve_local in leo_retriever::retriever - Rust

    Function leo_retriever::retriever::retrieve_local

    source ·
    fn retrieve_local(
         name: &String,
         path: &PathBuf
    -) -> Result<Vec<Dependency>, UtilError>
    \ No newline at end of file +) -> Result<Vec<Dependency>, UtilError>
    \ No newline at end of file diff --git a/leo_retriever/retriever/fn.verify_valid_program.html b/leo_retriever/retriever/fn.verify_valid_program.html index 7ef65f4c62..a2f416c3c9 100644 --- a/leo_retriever/retriever/fn.verify_valid_program.html +++ b/leo_retriever/retriever/fn.verify_valid_program.html @@ -1,4 +1,4 @@ verify_valid_program in leo_retriever::retriever - Rust

    Function leo_retriever::retriever::verify_valid_program

    source ·
    pub fn verify_valid_program<N: Network>(
         name: &str,
         program: &str
    -) -> Result<(), UtilError>
    \ No newline at end of file +) -> Result<(), UtilError> \ No newline at end of file diff --git a/leo_retriever/retriever/struct.Retriever.html b/leo_retriever/retriever/struct.Retriever.html index ad41852739..0d234ac9c9 100644 --- a/leo_retriever/retriever/struct.Retriever.html +++ b/leo_retriever/retriever/struct.Retriever.html @@ -1,23 +1,23 @@ Retriever in leo_retriever::retriever - Rust

    Struct leo_retriever::retriever::Retriever

    source ·
    pub struct Retriever<N: Network> {
    -    name: Symbol,
    -    contexts: IndexMap<Symbol, ProgramContext>,
    +    name: Symbol,
    +    contexts: IndexMap<Symbol, ProgramContext>,
         project_path: PathBuf,
         registry_path: PathBuf,
         endpoint: String,
         phantom: PhantomData<N>,
    -}

    Fields§

    §name: Symbol§contexts: IndexMap<Symbol, ProgramContext>§project_path: PathBuf§registry_path: PathBuf§endpoint: String§phantom: PhantomData<N>

    Implementations§

    source§

    impl<N: Network> Retriever<N>

    source

    pub fn new( - name: Symbol, +}

    Fields§

    §name: Symbol§contexts: IndexMap<Symbol, ProgramContext>§project_path: PathBuf§registry_path: PathBuf§endpoint: String§phantom: PhantomData<N>

    Implementations§

    source§

    impl<N: Network> Retriever<N>

    source

    pub fn new( + name: Symbol, path: &PathBuf, home: &Path, endpoint: String -) -> Result<Self, UtilError>

    source

    pub fn get_context(&self, name: &Symbol) -> &ProgramContext

    source

    pub fn retrieve(&mut self) -> Result<Vec<Symbol>, UtilError>

    source

    pub fn prepare_local( +) -> Result<Self, UtilError>

    source

    pub fn get_context(&self, name: &Symbol) -> &ProgramContext

    source

    pub fn retrieve(&mut self) -> Result<Vec<Symbol>, UtilError>

    source

    pub fn prepare_local( &mut self, - name: Symbol -) -> Result<(PathBuf, IndexMap<Symbol, Stub>), UtilError>

    source

    pub fn process_local( + name: Symbol +) -> Result<(PathBuf, IndexMap<Symbol, Stub>), UtilError>

    source

    pub fn process_local( &mut self, - name: Symbol, + name: Symbol, recursive: bool -) -> Result<(), UtilError>

    source

    fn write_lock_file(&self, name: &Symbol) -> Result<(), UtilError>

    Auto Trait Implementations§

    §

    impl<N> Freeze for Retriever<N>

    §

    impl<N> RefUnwindSafe for Retriever<N>
    where +) -> Result<(), UtilError>

    source

    fn write_lock_file(&self, name: &Symbol) -> Result<(), UtilError>

    Auto Trait Implementations§

    §

    impl<N> Freeze for Retriever<N>

    §

    impl<N> RefUnwindSafe for Retriever<N>
    where N: RefUnwindSafe,

    §

    impl<N> Send for Retriever<N>

    §

    impl<N> Sync for Retriever<N>

    §

    impl<N> Unpin for Retriever<N>
    where N: Unpin,

    §

    impl<N> UnwindSafe for Retriever<N>
    where N: UnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/search.desc/leo_errors/leo_errors-desc-0-.js b/search.desc/leo_errors/leo_errors-desc-0-.js index 82ace1fe24..7843f8ee57 100644 --- a/search.desc/leo_errors/leo_errors-desc-0-.js +++ b/search.desc/leo_errors/leo_errors-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("leo_errors", 0, "leo-errors\nContains the common functionalities for defining errors..\nA macro that given an enum, exit code mask, error code …\nContains traits and types for channels through which …\nContains the errors and warnings for the Leo lang.\nThis module contains a backtraced error and its methods.\nThis module contains a formatted error and its methods.\nThis module contains the macros for making errors easily.\nThis module contains traits for making errors easily.\nBacktraced compiler output type undefined value x –> …\nThe indent for an error message.\nThe backtrace representing where the error occurred in Leo.\nThe error exit code.\nThe error leading digits identifier.\nIs this Backtrace a warning or error?\nGets a unique error identifier.\nGets the backtraced error exit code.\nReturns the argument unchanged.\nThe error help message if it exists.\nCalls U::from(self).\nThe error message.\nCreates a backtraced error from a backtrace.\nThe characters representing the type of error.\nGets a unique warning identifier.\nFormatted compiler error type undefined value x –> …\nThe backtrace to track where the Leo error originated.\nReturns an error identifier.\nCalls the backtraces error exit code.\nReturns the argument unchanged.\nCalls U::from(self).\nCreates a backtraced error from a span and a backtrace.\nThe formatted error span information.\nReturns an warning identifier.\nMessageCode trait that all Errors should implement.\nThe LeoErrorCode which has a default code identifier of 037\nReturns the messages’s exit code mask, as to avoid …\nReturns the prefixed error identifier.\nReturns the error’s exit code for the program.\nReturns if the message is an error or warning.\nReturns the message’s code type for the program.\nReturns the prefixed warning identifier.\nA buffer of Ts.\nAn Emitter that collects into a list.\nTypes that are sinks for compiler errors.\nA buffer of LeoErrors.\nA handler deals with errors and other compiler output.\nContains the actual data for Handler. Modelled this way to …\nA trivial Emitter using the standard error.\nA buffer of LeoWarnings.\nEmit the error err.\nEmit the error err.\nEmit the error err.\nEmit the warning.\nEmit the error err.\nEmit the error err.\nThe sink through which errors will be emitted.\nThe number of errors thus far.\nNumber of errors emitted thus far.\nExtend handler with error given res = Err(error).\nExtracts all the errors collected in this emitter.\nExtracts all the errors collected in this emitter.\nEmits the error err. This will immediately abort …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nDid we have any errors thus far?\nThe inner handler. RefCell is used here to avoid &mut all …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nExtract the underlying list of Ts.\nTracks last emitted error.\nGets the last emitted error’s exit code.\nLast entry to the buffer.\nGets the last emitted error’s exit code if it exists. …\nExit code of the last emitted error.\nConstruct a Handler using the given emitter.\nReturns a new buffered emitter.\nConstruct a Handler that will append to buf.\nPush x to the buffer.\nNumber of warnings emitted thus far.\nThe number of warnings thus far.\nRuns logic provided a handler that collects all errors …\nAnyhow errors.\nRepresents an AST Error in a Leo Error.\nRepresents an CLI Error in a Leo Error.\nRepresents an Compiler Error in a Leo Error.\nContains the error value\nRepresents a Flatten Error in a Leo Error.\nPurely for just exiting with the correct status code and …\nThe LeoError type that contains all sub error types. This …\nThe LeoWarning type that contains all sub error types. …\nRepresents a Loop Unroller Error in a Leo Error.\nContains the success value\nRepresents an Package Error in a Leo Error.\nRepresents an Parser Error in a Leo Error.\nRepresents an Parser Error in a Leo Error.\nA global result type for all Leo crates, that defaults the …\nRepresents a Type Checker Error in a Leo Error.\nRepresents a Type Checker Error in a Leo Error.\nRepresents a Utils Error in a Leo Error\nContains the AST error definitions.\nContains the CLI error definitions.\nContains the Compiler error definitions.\nImplement error code for each type of Error.\nImplement warning code for each type of Warning.\nImplement exit code for each type of Error.\nContains the Flattener error definitions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nContains the Loop Unroller error definitions.\nContains the Package error definitions.\nContains the Parser error definitions.\nContains the Type Checker error definitions.\nContains the Utils error definitions.\nThis module contains the AST error definitions.\nAstError enum that represents all the errors for the …\nFor when the AST fails to be represented as a JSON string.\nFor when the AST fails to be represented as a JSON value.\nFor when the symbol table fails to be represented as a …\nFor when the symbol table fails to be represented as a …\nFor when the AST fails to create the AST JSON file.\nFor when the symbol table fails to create the symbol table …\nFor when the a JSON files fails to be represented as an …\nFor when the a JSON string fails to be represented as an …\nFor when the a JSON string fails to be represented as an …\nFor when the AST fails to write the AST JSON file.\nFor when the symbol table fails to write the symbol table …\nReturns the argument unchanged.\nCalls U::from(self).\nFor when a user shadows a function.\nFor when a user shadows a record.\nFor when a user shadows a struct.\nFor when a user shadows a variable.\nThis module contains the CLI error definitions.\nCliError enum that represents all the errors for the …\nFor when the CLI is given invalid user input.\nFor when the CLI experiences an IO error.\nFor when the CLI fails to run something\nFor when the CLI could not fetch the versions.\nFor when the CLI fails to enable ansi support.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when the CLI has an old release version.\nFor when the CLI fails to self update.\nFor when the CLI fails to self update.\nThis module contains the Compiler error definitions.\nCompilerError enum that represents all the errors for the …\nFor when the compiler can’t read a file from the …\nReturns the argument unchanged.\nFor when a user tries to assign to a struct static member.\nCalls U::from(self).\nThis module contains the Flattener error definitions.\nCliError enum that represents all the errors for the …\nFor when a constant operation would cause an overflow.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when a loop uses a negative value.\nGenerates the type name of a value.\nFor when a u128 value cannot be converted into an i128.\nFor when a constant operation would cause an overflow.\nThis module contains the Input error definitions.\nLoopUnrollerError enum that represents all the errors for …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Package error definitions.\nPackageError enum that represents all the errors for the …\nFor when opening a directory failed.\nFor when creating a directory failed.\nFor when creating the inputs directory failed.\nFor when creating the source directory failed.\nFor when getting a input file entry failed.\nFor when getting the input file type failed.\nFor when getting a Leo file entry failed.\nFor when getting the source file extension failed.\nFor when the package failed to initialize.\nFor when reading the checksum file failed.\nFor when reading the struct file failed.\nFor when file could not be read.\nFor when reading the input file failed.\nFor when reading the input directory failed.\nFor when reading the snapshot file failed.\nFor when removing the checksum file failed.\nFor when removing the struct file failed.\nFor when removing a directory failed.\nFor when removing the snapshot file failed.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when getting the input file has an invalid file type.\nFor when the Leo file has an invalid extension.\nFor when the package has an invalid name.\nFor when the checksum file has an IO error.\nFor when the struct file has an IO error.\nFor when the environment file has an IO error.\nFor when the gitignore file has an IO error.\nFor when the input file has an IO error.\nFor when the main file has an IO error.\nThis module contains the Parser error definitions.\nThis module contains the Parser warning definitions.\nParserError enum that represents all the errors for the …\nEnforce that cannot use import in program scope\nWhen the lexer could not lex some text.\nReturns the argument unchanged.\nWhen the user tries to pass an implicit value.\nFor when a user specified more than one mode on a …\nCalls U::from(self).\nFor when the parser encountered an invalid address literal.\nFor when the parser encountered an empty import list.\nParsed an unknown method call on the type of an expression.\nFor when the lexer encountered a bidi override character\nWhen a block comment is not closed before end of file.\nWhen a block comment is empty.\nWhen more input was expected but not found.\nWhen an integer is started with a leading zero.\nWhen a hex number is provided.\nWhen a string is not properly closed.\nFor when the parser encountered a mix of commas and …\nFor when the parser encountered an unexpected spread in an …\nEnforce that tuple index must not have leading 0, or …\nFor when the parser encountered an unexpected list of …\nFor when the parser encountered an unexpected End of File.\nFor when the parser encountered an unexpected identifier.\nFor when the parser encountered an unexpected statement.\nFor when the parser encountered an unexpected string.\nFor when the parser encountered an unexpected token.\nFor when the parser encountered an unexpected whitespace.\nParserWarning enum that represents all the warnings for …\nFor when a user used const on a parameter or input instead …\nFor when a keyword is deprecated but could be used as a …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Input error definitions.\nInputError enum that represents all the errors for the …\nFor when the user tries to assign to a const input.\nFor when the user tries to assign to a const input.\nFor when a struct is created with the same name as a core …\nFor when the type checker cannot determine the type of an …\nAttempted to define more that one record variable with the …\nAttempted to define more that one struct member with the …\nFor when one of the following types was expected.\nReturns the argument unchanged.\nFor when a function doesn’t have a return statement.\nFor when the user tries calls a function with the …\nFor when the user tries initialize a struct with the …\nCalls U::from(self).\nFor when the parser encountered an invalid assignment …\nA call to an invalid associated constant is made e.g., …\nFor when an invalid field of block is called.\nFor when an invalid core constant is called.\nFor when an invalid core function is used.\nAn invalid access call is made e.g., `SHA256::hash()\nFor when an integer is not in a valid range.\nAttempted to access an invalid struct variable.\nFor when the user is missing a struct member during …\nFor when the user tries to assign to a const input.\nAttempted to access an invalid struct.\nFor when the user tries to return a unknown variable.\nParserWarning enum that represents all the warnings for …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Input error definitions.\nInputError enum that represents all the errors for the …\nReturns the argument unchanged.\nCalls U::from(self).") \ No newline at end of file +searchState.loadedDescShard("leo_errors", 0, "leo-errors\nContains the common functionalities for defining errors.\nA macro that given an enum, exit code mask, error code …\nContains traits and types for channels through which …\nContains the errors and warnings for the Leo language.\nThis module contains a backtraced error and its methods.\nThis module contains a formatted error and its methods.\nThis module contains the macros for making errors easily.\nThis module contains traits for making errors easily.\nBacktraced compiler output type undefined value x –> …\nThe indent for an error message.\nThe backtrace representing where the error occurred in Leo.\nThe error exit code.\nThe error leading digits identifier.\nIs this Backtrace a warning or error?\nGets a unique error identifier.\nGets the backtraced error exit code.\nReturns the argument unchanged.\nThe error help message if it exists.\nCalls U::from(self).\nThe error message.\nCreates a backtraced error from a backtrace.\nThe characters representing the type of error.\nGets a unique warning identifier.\nFormatted compiler error type undefined value x –> …\nThe backtrace to track where the Leo error originated.\nReturns an error identifier.\nCalls the backtraces error exit code.\nReturns the argument unchanged.\nCalls U::from(self).\nCreates a backtraced error from a span and a backtrace.\nThe formatted error span information.\nReturns an warning identifier.\nMessageCode trait that all Errors should implement.\nThe LeoErrorCode which has a default code identifier of 037\nReturns the messages’s exit code mask, as to avoid …\nReturns the prefixed error identifier.\nReturns the error’s exit code for the program.\nReturns if the message is an error or warning.\nReturns the message’s code type for the program.\nReturns the prefixed warning identifier.\nA buffer of Ts.\nAn Emitter that collects into a list.\nTypes that are sinks for compiler errors.\nA buffer of LeoErrors.\nA handler deals with errors and other compiler output.\nContains the actual data for Handler. Modelled this way to …\nA trivial Emitter using the standard error.\nA buffer of LeoWarnings.\nEmit the error err.\nEmit the error err.\nEmit the error err.\nEmit the warning.\nEmit the error err.\nEmit the error err.\nThe sink through which errors will be emitted.\nThe number of errors thus far.\nNumber of errors emitted thus far.\nExtend handler with error given res = Err(error).\nExtracts all the errors collected in this emitter.\nExtracts all the errors collected in this emitter.\nEmits the error err. This will immediately abort …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nDid we have any errors thus far?\nThe inner handler. RefCell is used here to avoid &mut all …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nExtract the underlying list of Ts.\nTracks last emitted error.\nGets the last emitted error’s exit code.\nLast entry to the buffer.\nGets the last emitted error’s exit code if it exists. …\nExit code of the last emitted error.\nConstruct a Handler using the given emitter.\nReturns a new buffered emitter.\nConstruct a Handler that will append to buf.\nPush x to the buffer.\nNumber of warnings emitted thus far.\nThe number of warnings thus far.\nRuns logic provided a handler that collects all errors …\nAnyhow errors.\nRepresents an AST Error in a Leo Error.\nRepresents a CLI Error in a Leo Error.\nRepresents a Compiler Error in a Leo Error.\nContains the error value\nRepresents a Flatten Error in a Leo Error.\nPurely for just exiting with the correct status code and …\nThe LeoError type that contains all sub error types. This …\nThe LeoWarning type that contains all sub warning types. …\nRepresents a Loop Unroller Error in a Leo Error.\nContains the success value\nRepresents a Package Error in a Leo Error.\nRepresents a Parser Error in a Leo Error.\nRepresents an Parser Warning in a Leo Warning.\nA global result type for all Leo crates, that defaults the …\nRepresents a Type Checker Error in a Leo Error.\nRepresents a Type Checker Warning in a Leo Warning.\nRepresents a Utils Error in a Leo Error.\nContains the AST error definitions.\nContains the CLI error definitions.\nContains the Compiler error definitions.\nImplement error code for each type of Error.\nImplement warning code for each type of Warning.\nImplement exit code for each type of Error.\nContains the Flattener error definitions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nContains the Loop Unroller error definitions.\nContains the Package error definitions.\nContains the Parser error definitions.\nContains the Type Checker error definitions.\nContains the Utils error definitions.\nThis module contains the AST error definitions.\nAstError enum that represents all the errors for the …\nFor when the AST fails to be represented as a JSON string.\nFor when the AST fails to be represented as a JSON value.\nFor when the symbol table fails to be represented as a …\nFor when the symbol table fails to be represented as a …\nFor when the AST fails to create the AST JSON file.\nFor when the symbol table fails to create the symbol table …\nFor when the a JSON files fails to be represented as an …\nFor when the a JSON string fails to be represented as an …\nFor when the a JSON string fails to be represented as an …\nFor when the AST fails to write the AST JSON file.\nFor when the symbol table fails to write the symbol table …\nReturns the argument unchanged.\nCalls U::from(self).\nFor when a user shadows a function.\nFor when a user shadows a record.\nFor when a user shadows a struct.\nFor when a user shadows a variable.\nThis module contains the CLI error definitions.\nCliError enum that represents all the errors for the …\nFor when the CLI is given invalid user input.\nFor when the CLI experiences an IO error.\nFor when the CLI fails to run something\nFor when the CLI could not fetch the versions.\nFor when the CLI fails to enable ansi support.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when the CLI has an old release version.\nFor when the CLI fails to self update.\nFor when the CLI fails to self update.\nThis module contains the Compiler error definitions.\nCompilerError enum that represents all the errors for the …\nFor when the compiler can’t read a file from the …\nReturns the argument unchanged.\nFor when a user tries to assign to a struct static member.\nCalls U::from(self).\nThis module contains the Flattener error definitions.\nCliError enum that represents all the errors for the …\nFor when a constant operation would cause an overflow.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when a loop uses a negative value.\nGenerates the type name of a value.\nFor when a u128 value cannot be converted into an i128.\nFor when a constant operation would cause an overflow.\nThis module contains the Input error definitions.\nLoopUnrollerError enum that represents all the errors for …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Package error definitions.\nPackageError enum that represents all the errors for the …\nFor when opening a directory failed.\nFor when creating a directory failed.\nFor when creating the inputs directory failed.\nFor when creating the source directory failed.\nFor when getting a input file entry failed.\nFor when getting the input file type failed.\nFor when getting a Leo file entry failed.\nFor when getting the source file extension failed.\nFor when the package failed to initialize.\nFor when reading the checksum file failed.\nFor when reading the struct file failed.\nFor when file could not be read.\nFor when reading the input file failed.\nFor when reading the input directory failed.\nFor when reading the snapshot file failed.\nFor when removing the checksum file failed.\nFor when removing the struct file failed.\nFor when removing a directory failed.\nFor when removing the snapshot file failed.\nReturns the argument unchanged.\nCalls U::from(self).\nFor when getting the input file has an invalid file type.\nFor when the Leo file has an invalid extension.\nFor when the package has an invalid name.\nFor when the checksum file has an IO error.\nFor when the struct file has an IO error.\nFor when the environment file has an IO error.\nFor when the gitignore file has an IO error.\nFor when the input file has an IO error.\nFor when the main file has an IO error.\nThis module contains the Parser error definitions.\nThis module contains the Parser warning definitions.\nParserError enum that represents all the errors for the …\nEnforce that cannot use import in program scope\nWhen the lexer could not lex some text.\nReturns the argument unchanged.\nWhen the user tries to pass an implicit value.\nFor when a user specified more than one mode on a …\nCalls U::from(self).\nFor when the parser encountered an invalid address literal.\nFor when the parser encountered an empty import list.\nParsed an unknown method call on the type of an expression.\nFor when the lexer encountered a bidi override character\nWhen a block comment is not closed before end of file.\nWhen a block comment is empty.\nWhen more input was expected but not found.\nWhen an integer is started with a leading zero.\nWhen a hex number is provided.\nWhen a string is not properly closed.\nFor when the parser encountered a mix of commas and …\nFor when the parser encountered an unexpected spread in an …\nEnforce that tuple index must not have leading 0, or …\nFor when the parser encountered an unexpected list of …\nFor when the parser encountered an unexpected End of File.\nFor when the parser encountered an unexpected identifier.\nFor when the parser encountered an unexpected statement.\nFor when the parser encountered an unexpected string.\nFor when the parser encountered an unexpected token.\nFor when the parser encountered an unexpected whitespace.\nParserWarning enum that represents all the warnings for …\nFor when a user used const on a parameter or input instead …\nFor when a keyword is deprecated but could be used as a …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Input error definitions.\nInputError enum that represents all the errors for the …\nFor when the user tries to assign to a const input.\nFor when the user tries to assign to a const input.\nFor when a struct is created with the same name as a core …\nFor when the type checker cannot determine the type of an …\nAttempted to define more that one record variable with the …\nAttempted to define more that one struct member with the …\nFor when one of the following types was expected.\nReturns the argument unchanged.\nFor when a function doesn’t have a return statement.\nFor when the user tries calls a function with the …\nFor when the user tries initialize a struct with the …\nCalls U::from(self).\nFor when the parser encountered an invalid assignment …\nA call to an invalid associated constant is made e.g., …\nFor when an invalid field of block is called.\nFor when an invalid core constant is called.\nFor when an invalid core function is used.\nAn invalid access call is made e.g., `SHA256::hash()\nFor when an integer is not in a valid range.\nAttempted to access an invalid struct variable.\nFor when the user is missing a struct member during …\nFor when the user tries to assign to a const input.\nAttempted to access an invalid struct.\nFor when the user tries to return a unknown variable.\nParserWarning enum that represents all the warnings for …\nReturns the argument unchanged.\nCalls U::from(self).\nThis module contains the Input error definitions.\nInputError enum that represents all the errors for the …\nReturns the argument unchanged.\nCalls U::from(self).") \ No newline at end of file diff --git a/search.desc/leo_parser/leo_parser-desc-0-.js b/search.desc/leo_parser/leo_parser-desc-0-.js index 506792ab86..e0d5059209 100644 --- a/search.desc/leo_parser/leo_parser-desc-0-.js +++ b/search.desc/leo_parser/leo_parser-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("leo_parser", 0, "The parser to convert Leo code text into an [AST] type.\nRepresents all valid Leo keyword tokens. This also …\nCreates a new AST from a given file path and source code …\nThe parser to convert Leo code text into an Program AST …\nThe tokenizer to convert Leo code text into tokens.\nCreates a new program from a given file path and source …\nDummy span used to appease borrow checker.\nStores a program in tokenized format plus additional …\nConstructs a binary expression left op right.\nAdvances the parser cursor by one token.\nChecks whether the current token is tok.\nChecks whether the current token is a Token::Int(_).\ntrue if parsing an expression for if and loop statements …\nReturns true if the next token is equal to the given token.\nEats any of the given tokens, returning true if anything …\nEats one of binary operators matching any in tokens.\nRemoves the next two tokens if they are a pair of …\nEats the next token if its an identifier and returns it.\nRemoves the next token if it is a [Token::Integer(_)] and …\nEmit the error err.\nEmit the warning warning.\nEats the expected token, or errors.\nEats one of the expected tokens, or errors.\nExpects an Identifier, or errors.\nReturns the argument unchanged.\nHandler used to side-channel emit errors from the parser.\nReturns true if the next token exists.\nCalls U::from(self).\nLook-ahead dist tokens of self.token and get access to …\nAt the previous token, return and make an identifier with …\nReturns a new ParserContext type given a vector of tokens.\nCounter used to generate unique node ids.\nReturns an Expression AST node if the next tokens …\nReturns an Annotation AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a AssertStatement AST node if the next tokens …\nReturns a AssignStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nParses a left-associative binary expression …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Block AST node if the next tokens represent a …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens represent\nParse a list separated by , and delimited by brackets.\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens represent\nReturns a ConditionalStatement AST node if the next tokens …\nReturns a ConsoleStatement AST node if the next tokens …\nReturns a ConstDeclaration AST node if the next tokens …\nReturns a DefinitionStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nParses a tuple of Expression AST nodes.\nReturns an Expression AST node if the next token is an …\nReturns an [(Identifier, Function)] AST node if the next …\nParses an import statement import foo.leo;.\nReturns a Input AST node if the next tokens represent a …\nParses a list of Ts using inner The opening and closing …\nReturns an IterationStatement AST node if the next tokens …\nParses a mapping declaration, e.g. …\nReturns a Member AST node if the next tokens represent a …\nReturns an Expression AST node if the next tokens …\nReturns a [ParamMode] AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Output AST node if the next tokens represent a …\nParse a list separated by , and delimited by parens.\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next token is a …\nReturns a [(Type, Span)] tuple of AST nodes if the next …\nReturns a Program AST if all tokens can be consumed and …\nParses a program scope program foo.aleo { ... }.\nReturns a ReturnStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Statement AST node if the next tokens represent …\nParses a struct or record definition, e.g., …\nReturns an Expression AST node if the next tokens …\nReturns a Vec<Member> AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a [(Type, Span)] tuple of AST nodes if the next …\nParses IDENT: TYPE.\nReturns an Expression AST node if the next tokens …\nReturns a reference to the next token if it is a …\nReturns true if the current token is (.\nThe previous token, i.e., if p.tokens = ['3', *, '4'], …\nThe name of the program being parsed.\nThe current token, i.e., if p.tokens = ['3', *, '4'], then …\nReturns a IntegerType AST node if the given token is a …\nAll un-bumped tokens.\nReturns an unexpected error at the current token.\nCreates a new vector of spanned tokens from a given file …\nYields spanned tokens from the given source code text.\nReturns a dummy token at a dummy span.\nEat an identifier, that is, a string matching ‘[a-zA-Z][…\nEnsure that string contains no Unicode Bidirectional …\nReturns the argument unchanged.\nCalls U::from(self).\nChecks if a char is a Unicode Bidirectional Override code …\n{ ... }\n[ ... ]\nDescribes delimiters of a token sequence.\nRepresents all valid Leo keyword tokens. This also …\n( ... )\nRepresents all valid Leo syntax tokens.\nReturns a tuple: [(token length, token)] if the next token …\nReturns a tuple: [(integer length, integer token)] if an …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nReturns true if the self token equals a Leo keyword.\nConverts self to the corresponding Symbol if it is_keyword.\nReturns the open/close tokens that the delimiter …") \ No newline at end of file +searchState.loadedDescShard("leo_parser", 0, "The parser to convert Leo code text into an [AST] type.\nRepresents all valid Leo keyword tokens. This also …\nCreates a new AST from a given file path and source code …\nThe parser to convert Leo code text into a Program AST …\nThe tokenizer to convert Leo code text into tokens.\nCreates a new program from a given file path and source …\nDummy span used to appease borrow checker.\nStores a program in tokenized format plus additional …\nConstructs a binary expression left op right.\nAdvances the parser cursor by one token.\nChecks whether the current token is tok.\nChecks whether the current token is a Token::Integer(_).\nTrue if parsing an expression for if and loop statements …\nReturns true if the next token is equal to the given token.\nEats any of the given tokens, returning true if anything …\nEats one of binary operators matching any in tokens.\nRemoves the next two tokens if they are a pair of …\nEats the next token if it is an identifier and returns it.\nRemoves the next token if it is a [Token::Integer(_)] and …\nEmit the error err.\nEmit the warning warning.\nEats the expected token, or errors.\nEats one of the expected tokens, or errors.\nExpects an Identifier, or errors.\nReturns the argument unchanged.\nHandler used to side-channel emit errors from the parser.\nReturns true if the next token exists.\nCalls U::from(self).\nLook-ahead dist tokens of self.token and get access to …\nAt the previous token, return and make an identifier with …\nReturns a new ParserContext type given a vector of tokens.\nCounter used to generate unique node ids.\nReturns an Expression AST node if the next tokens …\nReturns an Annotation AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a AssertStatement AST node if the next tokens …\nReturns a AssignStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nParses a left-associative binary expression …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Block AST node if the next tokens represent a …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens represent\nParse a list separated by , and delimited by brackets.\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens represent\nReturns a ConditionalStatement AST node if the next tokens …\nReturns a ConsoleStatement AST node if the next tokens …\nReturns a ConstDeclaration AST node if the next tokens …\nReturns a DefinitionStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nParses a tuple of Expression AST nodes.\nReturns an Expression AST node if the next token is an …\nReturns an [(Identifier, Function)] AST node if the next …\nParses an import statement import foo.leo;.\nReturns a Input AST node if the next tokens represent a …\nParses a list of Ts using inner The opening and closing …\nReturns an IterationStatement AST node if the next tokens …\nParses a mapping declaration, e.g. …\nReturns a Member AST node if the next tokens represent a …\nReturns an Expression AST node if the next tokens …\nReturns a [ParamMode] AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Output AST node if the next tokens represent a …\nParse a list separated by , and delimited by parens.\nReturns an Expression AST node if the next tokens …\nReturns an Expression AST node if the next token is a …\nReturns a [(Type, Span)] tuple of AST nodes if the next …\nReturns a Program AST if all tokens can be consumed and …\nParses a program scope program foo.aleo { ... }.\nReturns a ReturnStatement AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a Statement AST node if the next tokens represent …\nParses a struct or record definition, e.g., …\nReturns an Expression AST node if the next tokens …\nReturns a Vec<Member> AST node if the next tokens …\nReturns an Expression AST node if the next tokens …\nReturns a [(Type, Span)] tuple of AST nodes if the next …\nParses IDENT: TYPE.\nReturns an Expression AST node if the next tokens …\nReturns a reference to the next token if it is a …\nReturns true if the current token is (.\nThe previous token, i.e., if p.tokens = ['3', *, '4'], …\nThe name of the program being parsed.\nThe current token, i.e., if p.tokens = ['3', *, '4'], then …\nReturns a IntegerType AST node if the given token is a …\nAll un-bumped tokens.\nReturns an unexpected error at the current token.\nCreates a new vector of spanned tokens from a given file …\nYields spanned tokens from the given source code text.\nReturns a dummy token at a dummy span.\nEat an identifier, that is, a string matching ‘[a-zA-Z][…\nEnsure that string contains no Unicode Bidirectional …\nReturns the argument unchanged.\nCalls U::from(self).\nChecks if a char is a Unicode Bidirectional Override code …\n{ ... }\n[ ... ]\nDescribes delimiters of a token sequence.\nRepresents all valid Leo keyword tokens. This also …\n( ... )\nRepresents all valid Leo syntax tokens.\nReturns a tuple: [(token length, token)] if the next token …\nReturns a tuple: [(integer length, integer token)] if an …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nReturns true if the self token equals a Leo keyword.\nConverts self to the corresponding Symbol if it is_keyword.\nReturns the open/close tokens that the delimiter …") \ No newline at end of file diff --git a/src/leo_errors/common/mod.rs.html b/src/leo_errors/common/mod.rs.html index 0ad05d4e71..ed2e903393 100644 --- a/src/leo_errors/common/mod.rs.html +++ b/src/leo_errors/common/mod.rs.html @@ -71,7 +71,7 @@ // Right now for cleanliness of calling error functions we say each argument implements one of the follow types rather than giving a specific type. // This allows us to just pass many types rather doing conversions cleaning up the code. -// The args can be made cleaneronce https://github.com/rust-lang/rust/issues/41517 or https://github.com/rust-lang/rust/issues/63063 hits stable. +// The args can be made cleaner once https://github.com/rust-lang/rust/issues/41517 or https://github.com/rust-lang/rust/issues/63063 hits stable. // Either of why would allows to generate a type alias for these trait implementing types. // pub(crate) type DisplayArg = impl std::fmt::Display; // pub(crate) type DebugArg = impl std::fmt::Debug; diff --git a/src/leo_errors/errors/mod.rs.html b/src/leo_errors/errors/mod.rs.html index e3d7e0c610..e450e94aca 100644 --- a/src/leo_errors/errors/mod.rs.html +++ b/src/leo_errors/errors/mod.rs.html @@ -221,16 +221,16 @@ /// Represents an AST Error in a Leo Error. #[error(transparent)] AstError(#[from] AstError), - /// Represents an CLI Error in a Leo Error. + /// Represents a CLI Error in a Leo Error. #[error(transparent)] CliError(#[from] CliError), - /// Represents an Compiler Error in a Leo Error. + /// Represents a Compiler Error in a Leo Error. #[error(transparent)] CompilerError(#[from] CompilerError), - /// Represents an Package Error in a Leo Error. + /// Represents a Package Error in a Leo Error. #[error(transparent)] PackageError(#[from] PackageError), - /// Represents an Parser Error in a Leo Error. + /// Represents a Parser Error in a Leo Error. #[error(transparent)] ParserError(#[from] ParserError), /// Represents a Type Checker Error in a Leo Error. @@ -246,7 +246,7 @@ /// not re-displaying an error. #[error("")] LastErrorCode(i32), - /// Represents a Utils Error in a Leo Error + /// Represents a Utils Error in a Leo Error. #[error(transparent)] UtilError(#[from] UtilError), /// Anyhow errors. @@ -294,14 +294,14 @@ } } -/// The LeoWarning type that contains all sub error types. -/// This allows a unified error type throughout the Leo crates. +/// The LeoWarning type that contains all sub warning types. +/// This allows a unified warning type throughout the Leo crates. #[derive(Debug, Error)] pub enum LeoWarning { - /// Represents an Parser Error in a Leo Error. + /// Represents an Parser Warning in a Leo Warning. #[error(transparent)] ParserWarning(#[from] ParserWarning), - /// Represents a Type Checker Error in a Leo Error. + /// Represents a Type Checker Warning in a Leo Warning. #[error(transparent)] TypeCheckerWarning(#[from] TypeCheckerWarning), } diff --git a/src/leo_errors/lib.rs.html b/src/leo_errors/lib.rs.html index 79a06710a7..e0b4d15171 100644 --- a/src/leo_errors/lib.rs.html +++ b/src/leo_errors/lib.rs.html @@ -55,7 +55,7 @@ #[macro_use] extern crate thiserror; -/// Contains the common functionalities for defining errors.. +/// Contains the common functionalities for defining errors. #[macro_use] pub mod common; pub use self::common::*; @@ -63,7 +63,7 @@ /// Contains traits and types for channels through which errors go. pub mod emitter; -/// Contains the errors and warnings for the Leo lang. +/// Contains the errors and warnings for the Leo language. pub mod errors; pub use self::errors::*;

    \ No newline at end of file diff --git a/src/leo_parser/parser/context.rs.html b/src/leo_parser/parser/context.rs.html index 9baa402090..b2e45c5433 100644 --- a/src/leo_parser/parser/context.rs.html +++ b/src/leo_parser/parser/context.rs.html @@ -299,7 +299,7 @@ /// The previous token, i.e., if `p.tokens = ['3', *, '4']`, /// then after two `p.bump()`s, we'll have `p.token = '*'` and `p.prev_token = '3'`. pub(crate) prev_token: SpannedToken, - /// true if parsing an expression for if and loop statements -- means struct inits are not legal + /// True if parsing an expression for if and loop statements -- means struct inits are not legal. pub(crate) disallow_struct_construction: bool, /// The name of the program being parsed. pub(crate) program_name: Option<Symbol>, @@ -355,7 +355,7 @@ &self.token.token == tok } - /// Checks whether the current token is a `Token::Int(_)`. + /// Checks whether the current token is a `Token::Integer(_)`. pub(super) fn check_int(&self) -> bool { matches!(&self.token.token, Token::Integer(_)) } @@ -402,7 +402,7 @@ Identifier { name, span, id: self.node_builder.next_id() } } - /// Eats the next token if its an identifier and returns it. + /// Eats the next token if it is an identifier and returns it. pub(super) fn eat_identifier(&mut self) -> Option<Identifier> { if let Token::Identifier(name) = self.token.token { self.bump(); diff --git a/src/leo_parser/parser/file.rs.html b/src/leo_parser/parser/file.rs.html index c5c2da0c72..0b833a9887 100644 --- a/src/leo_parser/parser/file.rs.html +++ b/src/leo_parser/parser/file.rs.html @@ -393,6 +393,7 @@ 393 394 395 +396
    // Copyright (C) 2019-2023 Aleo Systems Inc.
     // This file is part of the Leo library.
     
    @@ -470,11 +471,12 @@
             // Parse `foo`.
             let import_name = self.expect_identifier()?;
     
    -        // Parse `.aleo`.
    +        // Parse `.`.
             self.expect(&Token::Dot)?;
     
    -        if !self.eat(&Token::Aleo) {
    -            // Throw error for non-aleo files.
    +        // Parse network, which currently must be `aleo`.
    +        if !self.eat(&Token::Aleo) {
    +            // Throw error for non-aleo networks.
                 return Err(ParserError::invalid_network(self.token.span).into());
             }
     
    @@ -495,10 +497,10 @@
             // Set the program name in the context.
             self.program_name = Some(name.name);
     
    -        // Parse the program network.
    +        // Parse the `.`.
             self.expect(&Token::Dot)?;
     
    -        // Otherwise throw parser error
    +        // Parse the program network, which must be `aleo`, otherwise throw parser error.
             self.expect(&Token::Aleo).map_err(|_| ParserError::invalid_network(self.token.span))?;
     
             // Construct the program id.
    diff --git a/src/leo_parser/parser/mod.rs.html b/src/leo_parser/parser/mod.rs.html
    index b919bc0346..b549b8b101 100644
    --- a/src/leo_parser/parser/mod.rs.html
    +++ b/src/leo_parser/parser/mod.rs.html
    @@ -65,10 +65,10 @@
     // You should have received a copy of the GNU General Public License
     // along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
     
    -//! The parser to convert Leo code text into an [`Program`] AST type.
    +//! The parser to convert Leo code text into a [`Program`] AST type.
     //!
    -//! This module contains the [`parse()`] method which calls the underlying [`tokenize()`]
    -//! method to create a new program ast.
    +//! This module contains the [`parse()`] function which calls the underlying [`tokenize()`]
    +//! method to create a new program AST.
     
     use crate::{tokenizer::*, Token};
     
    diff --git a/src/leo_parser/tokenizer/lexer.rs.html b/src/leo_parser/tokenizer/lexer.rs.html
    index a1e7dc6348..acbf44a8e3 100644
    --- a/src/leo_parser/tokenizer/lexer.rs.html
    +++ b/src/leo_parser/tokenizer/lexer.rs.html
    @@ -462,6 +462,13 @@
     462
     463
     464
    +465
    +466
    +467
    +468
    +469
    +470
    +471
     
    // Copyright (C) 2019-2023 Aleo Systems Inc.
     // This file is part of the Leo library.
     
    @@ -618,8 +625,15 @@
         //     }
         // }
     
    -    /// Returns a tuple: [(integer length, integer token)] if an integer can be eaten, otherwise returns [`None`].
    -    /// An integer can be eaten if its bytes are at the front of the given `input` string.
    +    /// Returns a tuple: [(integer length, integer token)] if an integer can be eaten.
    +    /// An integer can be eaten if its characters are at the front of the given `input` string.
    +    /// If there is no input, this function returns an error.
    +    /// If there is input but no integer, this function returns the tuple consisting of
    +    /// length 0 and a dummy integer token that contains an empty string.
    +    /// However, this function is always called when the next character is a digit.
    +    /// This function eats a sequence of one or more digits and underscores
    +    /// (starting from a digit, as explained above, given when it is called),
    +    /// which corresponds to a numeral in the ABNF grammar.
         fn eat_integer(input: &mut Peekable<impl Iterator<Item = char>>) -> Result<(usize, Token)> {
             if input.peek().is_none() {
                 return Err(ParserError::lexer_empty_input().into());
    @@ -642,7 +656,7 @@
         }
     
         /// Returns a tuple: [(token length, token)] if the next token can be eaten, otherwise returns an error.
    -    /// The next token can be eaten if the bytes at the front of the given `input` string can be scanned into a token.
    +    /// The next token can be eaten if the characters at the front of the given `input` string can be scanned into a token.
         pub(crate) fn eat(input: &str) -> Result<(usize, Token)> {
             if input.is_empty() {
                 return Err(ParserError::lexer_empty_input().into());
    @@ -685,13 +699,13 @@
             // See the example with the different combinations for Mul, MulAssign, Pow, PowAssign below.
             let match_four = |
                 input: &mut Peekable<_>,
    -            first_token, // Mul '*'
    -            second_char, // '='
    -            second_token, // MulAssign '*='
    -            third_char, // '*'
    -            third_token, // Pow '**'
    -            fourth_char, // '='
    -            fourth_token // PowAssign '**='
    +            first_token, // e.e. Mul '*'
    +            second_char, // e.g. '='
    +            second_token, // e.g. MulAssign '*='
    +            third_char, // e.g. '*'
    +            third_token, // e.g. Pow '**'
    +            fourth_char, // e.g. '='
    +            fourth_token // e.g. PowAssign '**='
             | {
                 input.next();
                 Ok(if input.next_if_eq(&second_char).is_some() {
    @@ -716,7 +730,7 @@
                     // Find end string quotation mark.
                     // Instead of checking each `char` and pushing, we can avoid reallocations.
                     // This works because the code 34 of double quote cannot appear as a byte
    -                // in middle of a multi-byte UTF-8 encoding of a character,
    +                // in the middle of a multi-byte UTF-8 encoding of a character,
                     // because those bytes all have the high bit set to 1;
                     // in UTF-8, the byte 34 can only appear as the single-byte encoding of double quote.
                     let rest = &input_str[1..];
    @@ -770,7 +784,7 @@
                     if input.next_if_eq(&'/').is_some() {
                         // Find the end of the comment line.
                         // This works because the code 10 of line feed cannot appear as a byte
    -                    // in middle of a multi-byte UTF-8 encoding of a character,
    +                    // in the middle of a multi-byte UTF-8 encoding of a character,
                         // because those bytes all have the high bit set to 1;
                         // in UTF-8, the byte 10 can only appear as the single-byte encoding of line feed.
                         let comment = match input_str.as_bytes().iter().position(|c| *c == b'\n') {
    @@ -880,8 +894,8 @@
                         "record" => Token::Record,
                         "return" => Token::Return,
                         "scalar" => Token::Scalar,
    -                    "signature" => Token::Signature,
                         "self" => Token::SelfLower,
    +                    "signature" => Token::Signature,
                         "string" => Token::String,
                         "struct" => Token::Struct,
                         "transition" => Token::Transition,
    diff --git a/src/leo_parser/tokenizer/token.rs.html b/src/leo_parser/tokenizer/token.rs.html
    index 3c61d81bbc..787d113653 100644
    --- a/src/leo_parser/tokenizer/token.rs.html
    +++ b/src/leo_parser/tokenizer/token.rs.html
    @@ -420,6 +420,10 @@
     420
     421
     422
    +423
    +424
    +425
    +426
     
    // Copyright (C) 2019-2023 Aleo Systems Inc.
     // This file is part of the Leo library.
     
    @@ -451,22 +455,26 @@
     #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
     pub enum Token {
         // Comments
    -    CommentLine(String),
    -    CommentBlock(String),
    +    CommentLine(String),  // the string includes the starting '//' and the ending line feed
    +    CommentBlock(String), // the string includes the starting '/*' and the ending '*/'
     
    -    // Whitespace (we do not distinguish among different kinds here)
    +    // Whitespace (we do not distinguish among different kinds here)
         WhiteSpace,
     
         // Literals (= atomic literals and numerals in the ABNF grammar)
    -    // The string in Integer(String) consists of digits optionally followed by a type
    -    // The string in AddressLit(String) has the form `aleo1...`
    +    // The string in Integer(String) consists of digits
    +    // The string in AddressLit(String) has the form `aleo1...`.
         True,
         False,
    -    Integer(String), // = numeric literal or numeral in the ABNF grammar
    +    Integer(String), // = numeral (including tuple index) in the ABNF grammar
         AddressLit(String),
         StaticString(String),
    +    // The numeric literals in the ABNF grammar, which consist of numerals followed by types,
    +    // are represented not as single tokens here,
    +    // but as two separate tokens (one for the numeral and one for the type),
    +    // enforcing, during parsing, the absence of whitespace or comments between those two tokens.
     
    -    // Identifiers
    +    // Identifiers
         Identifier(Symbol),
     
         // Symbols
    diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js
    index 08111bb537..a6b75955a5 100644
    --- a/trait.impl/core/convert/trait.From.js
    +++ b/trait.impl/core/convert/trait.From.js
    @@ -2,5 +2,5 @@
     "leo_ast":[["impl From<&Value> for Type"],["impl From<&CompositeType> for Location"],["impl From<Value> for Type"],["impl From<usize> for NonNegativeNumber"],["impl From<String> for NonNegativeNumber"],["impl From<Identifier> for ProgramId"],["impl From<Function> for FunctionStub"],["impl From<FunctionStub> for Function"],["impl From<Stub> for ProgramScope"],["impl<N: Network> From<&Identifier<N>> for Identifier"],["impl<N: Network> From<&ProgramID<N>> for ProgramId"]],
     "leo_errors":[["impl From<AstError> for LeoError"],["impl From<CliError> for LeoError"],["impl From<CompilerError> for LeoError"],["impl From<FlattenError> for LeoError"],["impl From<LoopUnrollerError> for LeoError"],["impl From<PackageError> for LeoError"],["impl From<ParserError> for LeoError"],["impl From<ParserWarning> for LeoWarning"],["impl From<TypeCheckerError> for LeoError"],["impl From<TypeCheckerWarning> for LeoWarning"],["impl From<UtilError> for LeoError"],["impl From<Error> for LeoError"],["impl From<Backtraced> for AstError"],["impl From<Backtraced> for CliError"],["impl From<Backtraced> for CompilerError"],["impl From<Backtraced> for FlattenError"],["impl From<Backtraced> for LoopUnrollerError"],["impl From<Backtraced> for PackageError"],["impl From<Backtraced> for ParserError"],["impl From<Backtraced> for ParserWarning"],["impl From<Backtraced> for TypeCheckerError"],["impl From<Backtraced> for TypeCheckerWarning"],["impl From<Backtraced> for UtilError"],["impl From<Formatted> for AstError"],["impl From<Formatted> for CliError"],["impl From<Formatted> for CompilerError"],["impl From<Formatted> for FlattenError"],["impl From<Formatted> for LoopUnrollerError"],["impl From<Formatted> for PackageError"],["impl From<Formatted> for ParserError"],["impl From<Formatted> for ParserWarning"],["impl From<Formatted> for TypeCheckerError"],["impl From<Formatted> for TypeCheckerWarning"],["impl From<Formatted> for UtilError"]],
     "leo_lang":[["impl From<BuildOptions> for CompilerOptions"]],
    -"leo_retriever":[["impl From<&Dependency> for Symbol"],["impl From<&ProgramContext> for LockFileEntry"],["impl From<Dependency> for ProgramContext"]]
    +"leo_retriever":[["impl From<&Dependency> for Symbol"],["impl From<&ProgramContext> for LockFileEntry"],["impl From<Dependency> for ProgramContext"]]
     };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
    \ No newline at end of file