diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-07 09:57:26 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-07 09:57:26 -0700 |
| commit | 56b44cbf582fac32e31601fd2a7ae1d6cb8f71b2 (patch) | |
| tree | 2612e7862a4b57acff0e6223caf365a88c63e62a /source/slang/slang-stdlib.cpp | |
| parent | 975e4b326cd2ef3ef0341d1fb7509315b9dee555 (diff) | |
Fix up visitor approach.
The existing code used a catch-all `visit()` method, and then relied on overloading to find the right version (allowing fallback to a `visit()` method taking a base-class parameter).
This approach works, but has some big down-sides:
- When browsing the code, you have a bunch of identically-named methods, and it can be hard to find the one you want.
- It is impossible to use inheritance to implement fallback for `visit()` methods, because *any* method in the derived class with that name hides *all* methods with the same name in a base class
This change makes the `visit()` methods use the name of the corresponding syntax class, and then has visitors inherit the fallback methods they need from the base visitor template class.
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
0 files changed, 0 insertions, 0 deletions
