summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-stdlib.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-07 09:57:26 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-07 09:57:26 -0700
commit56b44cbf582fac32e31601fd2a7ae1d6cb8f71b2 (patch)
tree2612e7862a4b57acff0e6223caf365a88c63e62a /source/slang/slang-stdlib.cpp
parent975e4b326cd2ef3ef0341d1fb7509315b9dee555 (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