Group scattered AST visitors into a visitors package#7639
Group scattered AST visitors into a visitors package#7639wilzbach wants to merge 5 commits intodlang:masterfrom
visitors package#7639Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
79f8ce7 to
9d4e592
Compare
src/tests/cxxfrontend.c
Outdated
| #include "tokens.h" | ||
| #include "version.h" | ||
| #include "visitor.h" | ||
| #include "visitors/package.h" |
There was a problem hiding this comment.
Can this just be kept in toplevel? I'd be ok with a rename to visitors.h
There was a problem hiding this comment.
Sure, I wasn't fully sure about this anyways (that's why I kept this change as a separate commit).
9d4e592 to
c648663
Compare
c648663 to
110ecd9
Compare
110ecd9 to
90aaac2
Compare
90aaac2 to
7534b82
Compare
|
A little exposition on how this improves encapsulation would be nice. It's hard to tell from the diffs. |
7534b82 to
5a456ce
Compare
This group all the various visitors in the codebase neatly together, s.t. they are easy to find for an reader looking to learn more about DMD's visitors:
Hierarchy in
|
visitorsvisitors package
5a456ce to
02a409b
Compare
dub.sdl
Outdated
| "src/dmd/strictvisitor.d" | ||
| "src/dmd/visitors/transitive.d" \ | ||
| "src/dmd/visitors/permissive.d" \ | ||
| "src/dmd/visitors/strict.d" |
There was a problem hiding this comment.
Add "src/dmd/visitors/package.d"
There was a problem hiding this comment.
The reason why it didn't break, is because this package isn't used anymore. There's frontend now...
|
BTW, the convention for naming modules composed of two or more words is to separate the parts with an underscore. So how about renaming |
02a409b to
f422da1
Compare
752a4f2 to
36ed8b0
Compare
36ed8b0 to
684514d
Compare
3cbba87 to
b63d980
Compare
b63d980 to
e57af93
Compare
- semantic.d - stoppable.d - permissive.d - transitive.d
e57af93 to
ff8bc2f
Compare
|
(rebased)
@andralex @WalterBright so can we move forward here? It looks like the PR is blocked on your approval. |
Oh gawd, please no. No packages, no glorious shuffling everything around. |
|
Let's close this. I've pointed out several times a list of things that will substantively improve DMD's encapsulation, readability, maintainability, etc. I will prepare a better list and post it to the n.g. That's what we should be spending time on. |
Fair enough. Looking forward to the list! |

I started off by moving the four visitors (
parsetime,permissive,strict,transitive)to their own package.
Then
visitor.dandvisitorslooked a bit strange, so I movedvisitor.dtovisitors/package.dAs there is also
astXXXX,dmd.ast.visitorswould work too.CC @RazvanN7