when I want to be able to easily toggle sections of code. UHT is unable to parse this correctly and produces a ‘End of class header encountered inside comment’ error.
Thanks for pointing this out. The UHT and UBT are somewhat sensitive to comment formatting, and unexpected formatting can sometimes cause problems. I have entered a ticket to have this particular issue investigated further (UE-19772).
I did also discover a workaround. If you add a space, UHT will complete without any problems. Using your example, this works fine:
Just wanted to provide a quick update on this. A fix has been implemented for this issue. If you have built the Engine from source code, you can merge in this commit from GitHub. If you are using a binary version of the Engine installed by the Launcher, the fix will be included in a future version of the Engine.