Trailing comments within control structures nested within a switch case would break the determination of whether or not there is a terminating statement within the nested control structure.
Making the findNestedTerminator() method look for non-empty instead of non-whitespace tokens fixes that and shouldn't break the TerminatingComment check as that has it's own check whether the last token in the case statement is a comment.
Trailing comments within control structures nested within a switch case would break the determination of whether or not there is a terminating statement within the nested control structure.
Making the
findNestedTerminator()
method look for non-empty instead of non-whitespace tokens fixes that and shouldn't break theTerminatingComment
check as that has it's own check whether the last token in the case statement is a comment.Includes unit tests.
Fixes #3550