What's keeping us from having such a tool? It seems that after
one has a decent parser (that also keeps tracks of the source
ranges of AST nodes), it's easy to write code that does
syntactic modifications and then rewrites the source code. And
there's several D parsers out there already - so it should be
too much effort to get there.
Even I am working on a tool that can be easily retrofitted for
this purpose.
Or maybe I am misunderstanding the amount of semantic analysis
that would typically be required? Can someone give some
examples of modifications that would be useful for such a dfix
tool? (I haven't yet had the time to watch the full panel
video, if that's relevant)
Well, my recent efforts lead my to belief that I am in over my
head with this.
But ... many sufficiently simple transformations can be done with
a complex regex and for me that is faster, given the trouble I
have with writing ASTMatchers for Dscanner.
BTW. Does anyone know a good approch to a DSL describeing
AST-transformation patterns ?
What I currently have is SQL-like Syntax and I feel it won't
scale to complex selction and/or transformation patterns.
Input is welcome.