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
Forward statement resolution in AST seems to be a bit more complicated than it should. However, I am not yet sure how to handle it in the future.
Problematic with forward statement means that node can be anywhere. What that means is that reference for any particular statement can be:
In any object.
Defined in the same object but after it is executed.
Globally defined outside of any object at any point prior or after the statement execution.
Literally some types, for example events, structs, vars etc... Can be defined literally anywhere in the code and called out from literally anywhere.
Knowing the problem, dealing with solution becomes troublesome when types descriptions are in question. We basically need to understand the type itself and regularly I need to come back to references during testing as some type is not discovered efficiently. For example, node is not found at all, resulting in skewed AST results and panics due to type description object is not found.
For now I am patching the code to resolve it. However, I'd like in the future to find out proper way how to traverse through the tree and figure out all of the types without doing some ad-hoc kumbaya patches to the resolver.
Moreover, even if node is found, are we certain that that particular node corresponds to the proper reference or just globally defined reference? This calls for a node reverse lookup.
Anyway, just ideas posting here so this story can be upgraded in the future and perhaps better solution can be done.
This is just so we are on a same page, a severe amount of work and will broke the entire code resolution once touched.
The text was updated successfully, but these errors were encountered:
One of the ideas is to build node trees prior ast is built. However, generics in Go still sucks in this particular case especially if you wish to lets say build sane protocol buffer representation of each node and in the end having it result with nice JSON without bunch of things in the object that do not even relate to the expression itself.
Note that at this moment, until millions of contracts are parsed through it there's no valid reason of doing this task as we need to know all of the edge cases prior doing anything sane.
Forward statement resolution in AST seems to be a bit more complicated than it should. However, I am not yet sure how to handle it in the future.
Problematic with forward statement means that node can be anywhere. What that means is that reference for any particular statement can be:
Knowing the problem, dealing with solution becomes troublesome when types descriptions are in question. We basically need to understand the type itself and regularly I need to come back to references during testing as some type is not discovered efficiently. For example, node is not found at all, resulting in skewed AST results and panics due to type description object is not found.
For now I am patching the code to resolve it. However, I'd like in the future to find out proper way how to traverse through the tree and figure out all of the types without doing some ad-hoc kumbaya patches to the resolver.
Moreover, even if node is found, are we certain that that particular node corresponds to the proper reference or just globally defined reference? This calls for a node reverse lookup.
Anyway, just ideas posting here so this story can be upgraded in the future and perhaps better solution can be done.
This is just so we are on a same page, a severe amount of work and will broke the entire code resolution once touched.
The text was updated successfully, but these errors were encountered: