One image it’s a great way to show the current status:
As you can see we still have (a lot of) work to do… But we can:
- Choose the scope where we run the run (right now a class/es or a package/packages)
- Enter the expresion for matching and transforming
- Search the matches
- Apply the entire rule (matching expresion + transforming)
- We have some actions implemented for the menus (same code, containing code, defining a variable)
- Inspect the result for a Search or Transformation action
But still now I have some thing that I observed: The rewrite engine its in fact very cool, and surely does everything we want to do.
But it’s very complex you have to choose the matcher , modify the pattern (is an expression? is a method? you have multiple options? is about an argument?), set the environment (do you want to run where? each Environment is represented but wait! Which matcher are you using? Because not all have the feature, and they are not all polimorfic when you want to match. And of course do not even talk about the regular expresions and the usual doubts we have (with temps? with N arguments? previous statements? and don’t forget the dot!), and… before starting… do you want to match? or do you want to transform? You have to choose!
And usually you don’t have all the information to choose that in an early moment, so what I’ve done it’s to implement a rule that delegates in existing components but takes the desitions for you… By example: Do you want to transform? Or just match? That depends… do we have a transformation expression? If that is true we want to search and replace.
testMatchAnUndefinedExpressionNotFind | rule | rule := FlamelMatchAndTransformRule new. rule matchingExpression: 'testFlamelFlamelNotDefinedInAnyPlaceNever'. rule scope: (RBClassEnvironment class: FlamelSearchMock ). rule run. self assert: (rule result isEmpty )
I want to change that to be something like:
testMatchAnUndefinedExpressionNotFind | rule | rule := FlamelMatchAndTransformRule new. rule matchingExpression: 'testFlamelFlamelNotDefinedInAnyPlaceNever'. rule applyToClass: FlamelSearchMock. rule run. self assert: (rule result isEmpty )
So, I have lot of work!
Some known bugs, and some unknown you can check the todo list in a Trello dashboard: https://trello.com/b/XqfJGqeB/flamel
It would be great to improve the UI because it’s quite “rustic”.
And my plan for this week it’s:
- Implement result views ==> with this one we have a first real prototype for the tool because we can: filter the scope, enter a matching/transforming expression and understand the results
- Implement actions for transforming menu
To open the browser just:
Flamel new openWithSpec
All the comments that you have are very wellcome, please don’t hestiate in comment or send me an email directly to me: email@example.com.
Have a great week and nice coding!