You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to add string to the Phases Reducer, allowing type-inference to handle characters.
Depends on #943.
Motivation
Right now, each of the AST and ASG relies on a reducer to handle certain phases such as canonicalization, type inference, etc.
The goal is to update the Reducers allowing for compilation.
Implementation
AST
Reducer
A new function reduce_string should be added to the trait ReconstructingReducer block leo/ast/src/reducer/reconstructing_reducer.rs. It should return an Expression.
Need to modify reduce_value to return an Expression.
Director
A new function reduce_string should be added to the impl<R: ReconstructingReducer> ReconstructingDirector<R> block leo/ast/src/reducer/reconstructing_director.rs. The function should return the string Value Expression Node wrapped in an Expression Node.
The reduce_value function should match the string Value Expression Node and call reduce_string. It should be modified to return an expression.
The reduce_expression function should return the expression rather than type wrapping it.
Canonicalization
A new function reduce_string should be added to the impl ReconstructingReducer for Canonicalizer block.
The function should convert the string AST Node to an ArrayInline Expression Node.
Tests
Compiler Tests:
Assigning a string.
Explicit.
Non-Explicit. Type Inference Should be tested here as well.
Should test after Canonicalization a string is an inline-array.
Passing a string to functions.
Circuit member variable string fields.
Global const string.
The text was updated successfully, but these errors were encountered:
馃殌 Feature
The goal is to add
string
to the Phases Reducer, allowing type-inference to handle characters.Depends on #943.
Motivation
Right now, each of the AST and ASG relies on a reducer to handle certain phases such as canonicalization, type inference, etc.
The goal is to update the Reducers allowing for compilation.
Implementation
AST
reduce_string
should be added to thetrait ReconstructingReducer
blockleo/ast/src/reducer/reconstructing_reducer.rs
. It should return an Expression.reduce_value
to return an Expression.reduce_string
should be added to theimpl<R: ReconstructingReducer> ReconstructingDirector<R>
blockleo/ast/src/reducer/reconstructing_director.rs
. The function should return thestring
Value Expression Node wrapped in an Expression Node.reduce_value
function should match thestring
Value Expression Node and callreduce_string
. It should be modified to return an expression.reduce_expression
function should return the expression rather than type wrapping it.reduce_string
should be added to theimpl ReconstructingReducer for Canonicalizer
block.string
AST Node to anArrayInline
Expression Node.Tests
string
.string
is an inline-array.string
to functions.string
fields.string
.The text was updated successfully, but these errors were encountered: