See this sample:
The #endif directive is missing in the converter output.
This seems related to both your changes (in ) and (and old, and difficult issues).
Let me know if you see a solution here.
If difficult, this could be postponed.
See `Backup/MissingDirectives` branch for related changes from SWC-801, some were included and some were not.
Some code fragments aren’t fully obvious, but I got the thought that some hidden tokens might be skipped unintentionally.
I fixed example’s case via manually hidden tokens extraction of RBRACE(“}”) token from instanceVariables parser rule. Basically, I’d rather create some parser rule/predicate which matches RBRACEsin particular(I’m not sure it’s necessary for all RBRACEs occurrences) and do process those hidden tokens.
Your fix for this specific case looks like a minimally accepted version.
If you have time for a more generic solution, that would be awesome.
Otherwise, just put this task in review, and we will revisit the generic case solution later.