Closed gazayas closed 1 year ago
There's a lot here, but I'm really happy with how it's turning out. The original search
method was an absolute mess, but I was still getting familiar with the types of nodes that exist and how to retrieve data nodes from them so I don't mind too much.
Things are a lot easier to manage now, so I can focus on the type of data I want to return. After things are settled with that, the next step is to move on to the code replacement class, and then the plan is to actually use this gem in an actual project.
This pull request introduces the following classes:
Masamune::AbstractSyntaxTree::Node
Masamune::AbstractSyntaxTree::DataNode
Masamune::AbstractSyntaxTree::NodeRegistry
Extracting this information from
Masamune::AbstractSyntaxTree
will help to understand what types of nodes exist within the tree and how different types are handled since they each have their own structure. Thesearch
function is pretty cluttered right now too, so I'm hoping it will be easier to read after finishing this pull request.