12.2. Comments

12.2.1. Single-Character Delimiters
12.2.2. Multi-Character Delimiters
12.2.3. One-Sided Comments

Up until now I have carefully avoided the subject of comments. You would think that this would be an easy subject … after all, the compiler doesn't have to deal with comments at all; it should just ignore them. Well, sometimes that's true.

Comments can be just about as easy or as difficult as you choose to make them. At one extreme, we can arrange things so that comments are intercepted almost the instant they enter the compiler. At the other, we can treat them as lexical elements. Things tend to get interesting when you consider things like comment delimiters contained in quoted strings.