Implement flags.had_comment, fix #329, fix #291

We deliberately lose token_type = TK_COMMENT and TK_INLINE_COMMENT to
allow their transparent handling. To counteract this, flags.had_comment
counter-spell is implemented, so that we had a possibility to know that
there was, in fact, a comment somewhere.

Thus, we can fix some corner-cases where an unexpected comment might
break the structure.