(First, on behalf of people of people who answer questions on forums everywhere...Thanks. Fantastic job of documenting errors messages and repro steps. This warms my heart)
I suspect you've already opened a support case, but if not, can you do so? Our support folks should be made aware of this if they're not already. They have Teradata boxes they should be able to test/repro on themselves.
I frankly don't know if this is expected behavior or a bug, but if nothing else, we want to get this into our systems...
I had the same issue. Through a careful statement-by-statement troubleshooting process, I found that it was a comment that had a question mark in it.
I can't give the why because (a) it makes no sense and (b) I haven't seen anyone else run into it. For comparison, I was using Tableau 8.2 and Teradata 14.10.
This error comes if there are any special characters in the code. These special characters messes up the code formatting with additional indentations. To get rid of these errors, you can replace the indentations/tabs/special-characters with spaces as required.