diff --git a/help.html b/help.html index e99e3aa438..9cfc05f900 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -
pub struct ArrayAccess {
pub array: Box<Expression>,
pub index: Box<Expression>,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An array access expression, e.g., foo[index]
.
array: Box<Expression>
An expression evaluating to some array type, e.g., [false, true]
.
index: Box<Expression>
The index to access in the array expression. E.g., 0
for [false, true]
would yield false
.
span: Span
The span for the entire expression foo[index]
.
span: Span
The span for the entire expression foo[index]
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct AssociatedConstant {
pub ty: Type,
pub name: Identifier,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An access expression to an struct constant., e.g. u8::MAX
.
ty: Type
The inner struct type.
name: Identifier
The struct constant that is being accessed.
-span: Span
The span for the entire expression Foo::bar()
.
span: Span
The span for the entire expression Foo::bar()
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.An access expression to an associated function in a struct, e.g.Pedersen64::hash()
.
variant: Identifier
The inner struct variant.
name: Identifier
The static struct member function that is being accessed.
arguments: Vec<Expression>
The arguments passed to the function name
.
span: Span
The span for the entire expression Foo::bar()
.
span: Span
The span for the entire expression Foo::bar()
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct MemberAccess {
pub inner: Box<Expression>,
pub name: Identifier,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A struct member access expression inner.name
to some structure with named members.
inner: Box<Expression>
The inner struct that is being accessed.
name: Identifier
The name of the struct member to access.
-span: Span
The span covering all of inner.name
.
span: Span
The span covering all of inner.name
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct ArrayAccess {
pub array: Box<Expression>,
pub index: Box<Expression>,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An array access expression, e.g., foo[index]
.
array: Box<Expression>
An expression evaluating to some array type, e.g., [false, true]
.
index: Box<Expression>
The index to access in the array expression. E.g., 0
for [false, true]
would yield false
.
span: Span
The span for the entire expression foo[index]
.
span: Span
The span for the entire expression foo[index]
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct AssociatedConstant {
pub ty: Type,
pub name: Identifier,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An access expression to an struct constant., e.g. u8::MAX
.
ty: Type
The inner struct type.
name: Identifier
The struct constant that is being accessed.
-span: Span
The span for the entire expression Foo::bar()
.
span: Span
The span for the entire expression Foo::bar()
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.An access expression to an associated function in a struct, e.g.Pedersen64::hash()
.
variant: Identifier
The inner struct variant.
name: Identifier
The static struct member function that is being accessed.
arguments: Vec<Expression>
The arguments passed to the function name
.
span: Span
The span for the entire expression Foo::bar()
.
span: Span
The span for the entire expression Foo::bar()
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct MemberAccess {
pub inner: Box<Expression>,
pub name: Identifier,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A struct member access expression inner.name
to some structure with named members.
inner: Box<Expression>
The inner struct that is being accessed.
name: Identifier
The name of the struct member to access.
-span: Span
The span covering all of inner.name
.
span: Span
The span covering all of inner.name
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct TupleAccess {
pub tuple: Box<Expression>,
pub index: NonNegativeNumber,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A tuple access expression, e.g., tuple.index
.
tuple: Box<Expression>
An expression evaluating to some tuple type, e.g., (5, 2)
.
index: NonNegativeNumber
The index to access in the tuple expression. E.g., 0
for (5, 2)
would yield 5
.
span: Span
The span for the entire expression tuple.index
.
span: Span
The span for the entire expression tuple.index
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct TupleAccess {
pub tuple: Box<Expression>,
pub index: NonNegativeNumber,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A tuple access expression, e.g., tuple.index
.
tuple: Box<Expression>
An expression evaluating to some tuple type, e.g., (5, 2)
.
index: NonNegativeNumber
The index to access in the tuple expression. E.g., 0
for (5, 2)
would yield 5
.
span: Span
The span for the entire expression tuple.index
.
span: Span
The span for the entire expression tuple.index
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct Identifier {
- pub name: Symbol,
- pub span: Span,
+ pub name: Symbol,
+ pub span: Span,
pub id: NodeID,
}
An identifier in a program.
Attention - When adding or removing fields from this struct, please remember to update its Serialize and Deserialize implementation to reflect the new struct instantiation.
-name: Symbol
The symbol that the user wrote, e.g., foo
.
span: Span
A span locating where the identifier occurred in the source.
+name: Symbol
The symbol that the user wrote, e.g., foo
.
span: Span
A span locating where the identifier occurred in the source.
id: NodeID
The ID of the node.
-Constructs a new identifier with name
and id
and a default span.
source
. Read moresource
. Read morepub fn deserialize<'de, D: Deserializer<'de>>(
deserializer: D,
-) -> Result<IndexMap<Vec<Symbol>, Program>, D::Error>
pub struct Location {
- pub program: Option<Symbol>,
- pub name: Symbol,
-}
program: Option<Symbol>
§name: Symbol
program: Option<Symbol>
§name: Symbol
pub trait Node: Debug + Display + Clone + PartialEq + Eq + Serialize + DeserializeOwned {
// Required methods
- fn span(&self) -> Span;
- fn set_span(&mut self, span: Span);
+ fn span(&self) -> Span;
+ fn set_span(&mut self, span: Span);
fn id(&self) -> NodeID;
fn set_id(&mut self, id: NodeID);
}
A node in the AST.
-An expression accessing a field in a structure, e.g., struct_var.field
.
Access to a tuple field using its position, e.g., tuple.1
.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct ArrayExpression {
pub elements: Vec<Expression>,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An array expression, e.g., [true, false, true, false]
.
elements: Vec<Expression>
The elements of the array.
-span: Span
The span from [
to ]
.
span: Span
The span from [
to ]
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.Subtraction, i.e. -
, .sub()
.
Wrapped subtraction, i.e. .sub_wrapped()
.
Bitwise XOR, i.e. .xor()
.
Returns a BinaryOperation
from the given Symbol
.
+
Returns a BinaryOperation
from the given Symbol
.
This is used to resolve native operators invoked as method calls, e.g. a.add_wrapped(b)
.
source
. Read moreself
and other
values to be equal, and is used
diff --git a/leo_ast/expressions/binary/struct.BinaryExpression.html b/leo_ast/expressions/binary/struct.BinaryExpression.html
index ab78677328..72f580f1e5 100644
--- a/leo_ast/expressions/binary/struct.BinaryExpression.html
+++ b/leo_ast/expressions/binary/struct.BinaryExpression.html
@@ -2,17 +2,17 @@
pub left: Box<Expression>,
pub right: Box<Expression>,
pub op: BinaryOperation,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}A binary expression left op right
of two operands separated by some operator.
For example, foo + bar
.
left: Box<Expression>
The left operand of the expression.
right: Box<Expression>
The right operand of the expression.
op: BinaryOperation
The operand defining the meaning of the resulting binary expression.
-span: Span
The span from left
to right
.
span: Span
The span from left
to right
.
id: NodeID
The ID of the expression.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct CallExpression {
pub function: Box<Expression>,
pub arguments: Vec<Expression>,
- pub program: Option<Symbol>,
- pub span: Span,
+ pub program: Option<Symbol>,
+ pub span: Span,
pub id: NodeID,
}
A function call expression, e.g.foo(args)
or Foo::bar(args)
.
function: Box<Expression>
An expression evaluating to a callable function, either a member of a structure or a free function.
arguments: Vec<Expression>
Expressions for the arguments passed to the functions parameters.
-program: Option<Symbol>
The name of the parent program call, e.g.bar
in bar.aleo
.
span: Span
Span of the entire call function(arguments)
.
program: Option<Symbol>
The name of the parent program call, e.g.bar
in bar.aleo
.
span: Span
Span of the entire call function(arguments)
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct CastExpression {
pub expression: Box<Expression>,
pub type_: Type,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A cast expression, e.g. 42u8 as u16
.
expression: Box<Expression>
The expression to be casted, e.g.42u8
in 42u8 as u16
.
type_: Type
The type to be casted to, e.g. u16
in 42u8 as u16
.
span: Span
Span of the entire cast 42u8 as u16
.
span: Span
Span of the entire cast 42u8 as u16
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.An expression accessing a field in a structure, e.g., struct_var.field
.
Access to a tuple field using its position, e.g., tuple.1
.
source
. Read moreself
and other
values to be equal, and is used
by ==
.Subtraction, i.e. -
, .sub()
.
Wrapped subtraction, i.e. .sub_wrapped()
.
Bitwise XOR, i.e. .xor()
.
Returns a BinaryOperation
from the given Symbol
.
+
Returns a BinaryOperation
from the given Symbol
.
This is used to resolve native operators invoked as method calls, e.g. a.add_wrapped(b)
.
source
. Read moreself
and other
values to be equal, and is used
diff --git a/leo_ast/expressions/enum.Expression.html b/leo_ast/expressions/enum.Expression.html
index d8c88a6a03..0fd021e0e3 100644
--- a/leo_ast/expressions/enum.Expression.html
+++ b/leo_ast/expressions/enum.Expression.html
@@ -30,7 +30,7 @@
An unary expression.
A unit expression e.g. ()
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub enum Literal {
- Address(String, Span, NodeID),
- Boolean(bool, Span, NodeID),
- Field(String, Span, NodeID),
+ Address(String, Span, NodeID),
+ Boolean(bool, Span, NodeID),
+ Field(String, Span, NodeID),
Group(Box<GroupLiteral>),
- Integer(IntegerType, String, Span, NodeID),
- Scalar(String, Span, NodeID),
- String(String, Span, NodeID),
+ Integer(IntegerType, String, Span, NodeID),
+ Scalar(String, Span, NodeID),
+ String(String, Span, NodeID),
}
A literal.
-An address literal, e.g., aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9
or hello.aleo
.
A boolean literal, either true
or false
.
A field literal, e.g., 42field
.
+
An address literal, e.g., aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9
or hello.aleo
.
A boolean literal, either true
or false
.
A field literal, e.g., 42field
.
A signed number followed by the keyword field
.
A group literal, either product or affine.
For example, 42group
or (12, 52)group
.
An integer literal, e.g., 42
.
A scalar literal, e.g. 1scalar
.
+
An integer literal, e.g., 42
.
A scalar literal, e.g. 1scalar
.
An unsigned number followed by the keyword scalar
.
A string literal, e.g., "foobar"
.
A string literal, e.g., "foobar"
.
Square root operation, i.e. .sqrt()
.
Converts a group element to its x-coordinate, i.e. .to_x_coordinate()
.
Converts a group element to its y-coordinate, i.e. .to_y_coordinate()
.
Returns a UnaryOperation
from the given Symbol
.
source
. Read moreself
and other
values to be equal, and is used
diff --git a/leo_ast/expressions/err/struct.ErrExpression.html b/leo_ast/expressions/err/struct.ErrExpression.html
index 00937dec47..df2da34d06 100644
--- a/leo_ast/expressions/err/struct.ErrExpression.html
+++ b/leo_ast/expressions/err/struct.ErrExpression.html
@@ -1,11 +1,11 @@
pub struct ErrExpression {
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
Represents a syntactically invalid expression.
-span: Span
The span of the invalid expression.
+span: Span
The span of the invalid expression.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub enum Literal {
- Address(String, Span, NodeID),
- Boolean(bool, Span, NodeID),
- Field(String, Span, NodeID),
+ Address(String, Span, NodeID),
+ Boolean(bool, Span, NodeID),
+ Field(String, Span, NodeID),
Group(Box<GroupLiteral>),
- Integer(IntegerType, String, Span, NodeID),
- Scalar(String, Span, NodeID),
- String(String, Span, NodeID),
+ Integer(IntegerType, String, Span, NodeID),
+ Scalar(String, Span, NodeID),
+ String(String, Span, NodeID),
}
A literal.
-An address literal, e.g., aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9
or hello.aleo
.
A boolean literal, either true
or false
.
A field literal, e.g., 42field
.
+
An address literal, e.g., aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9
or hello.aleo
.
A boolean literal, either true
or false
.
A field literal, e.g., 42field
.
A signed number followed by the keyword field
.
A group literal, either product or affine.
For example, 42group
or (12, 52)group
.
An integer literal, e.g., 42
.
A scalar literal, e.g. 1scalar
.
+
An integer literal, e.g., 42
.
A scalar literal, e.g. 1scalar
.
An unsigned number followed by the keyword scalar
.
A string literal, e.g., "foobar"
.
A string literal, e.g., "foobar"
.
pub struct LocatorExpression {
pub program: ProgramId,
- pub name: Symbol,
- pub span: Span,
+ pub name: Symbol,
+ pub span: Span,
pub id: NodeID,
}
A locator that references an external resource.
program: ProgramId
The program that the resource is in.
-name: Symbol
The name of the resource.
-span: Span
A span indicating where the locator occurred in the source.
+name: Symbol
The name of the resource.
+span: Span
A span indicating where the locator occurred in the source.
id: NodeID
The ID of the node.
-Constructs a new Locator with name
, program
and id
and a default span.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct ArrayExpression {
pub elements: Vec<Expression>,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
An array expression, e.g., [true, false, true, false]
.
elements: Vec<Expression>
The elements of the array.
-span: Span
The span from [
to ]
.
span: Span
The span from [
to ]
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.A binary expression left op right
of two operands separated by some operator.
For example, foo + bar
.
left: Box<Expression>
The left operand of the expression.
right: Box<Expression>
The right operand of the expression.
op: BinaryOperation
The operand defining the meaning of the resulting binary expression.
-span: Span
The span from left
to right
.
span: Span
The span from left
to right
.
id: NodeID
The ID of the expression.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct CallExpression {
pub function: Box<Expression>,
pub arguments: Vec<Expression>,
- pub program: Option<Symbol>,
- pub span: Span,
+ pub program: Option<Symbol>,
+ pub span: Span,
pub id: NodeID,
}
A function call expression, e.g.foo(args)
or Foo::bar(args)
.
function: Box<Expression>
An expression evaluating to a callable function, either a member of a structure or a free function.
arguments: Vec<Expression>
Expressions for the arguments passed to the functions parameters.
-program: Option<Symbol>
The name of the parent program call, e.g.bar
in bar.aleo
.
span: Span
Span of the entire call function(arguments)
.
program: Option<Symbol>
The name of the parent program call, e.g.bar
in bar.aleo
.
span: Span
Span of the entire call function(arguments)
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct CastExpression {
pub expression: Box<Expression>,
pub type_: Type,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A cast expression, e.g. 42u8 as u16
.
expression: Box<Expression>
The expression to be casted, e.g.42u8
in 42u8 as u16
.
type_: Type
The type to be casted to, e.g. u16
in 42u8 as u16
.
span: Span
Span of the entire cast 42u8 as u16
.
span: Span
Span of the entire cast 42u8 as u16
.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct ErrExpression {
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
Represents a syntactically invalid expression.
-span: Span
The span of the invalid expression.
+span: Span
The span of the invalid expression.
id: NodeID
The ID of the node.
source
. Read moreself
and other
values to be equal, and is used
by ==
.pub struct StructExpression {
pub name: Identifier,
pub members: Vec<StructVariableInitializer>,
- pub span: Span,
+ pub span: Span,
pub id: NodeID,
}
A struct initialization expression, e.g., Foo { bar: 42, baz }
.
name: Identifier
The name of the structure type to initialize.
members: Vec<StructVariableInitializer>
Initializer expressions for each of the fields in the struct.
N.B. Any functions or member constants in the struct definition are excluded from this list.
-span: Span
A span from name
to }
.
span: Span
A span from name
to }
.
id: NodeID
The ID of the node.
Returns true if the record has all required fields and visibility.
Returns the struct as a record interface with visibility.
source
. Read moreself
and other
values to be equal, and is used
by ==
.