If a ' or " doesn't have a matching terminator on the same line, this is not a valid token. The newline character at the end of the line is not allowed.
gcc -E issues a warning, and then emits the quote followed by the remainder of the line. I don't know what actual tokens are passed to the compiler without the -E switch.
pcpp fails to match the regex and produces a token for just the quote character, then tokenizes the rest of the line.
In order to keep a program which is using the tokens produced by pcpp from getting confused, I think that an error should be generated. Perhaps a character or string literal token should be produced as though the missing terminator appeared at the end of the line.
If a ' or " doesn't have a matching terminator on the same line, this is not a valid token. The newline character at the end of the line is not allowed.
gcc -E
issues a warning, and then emits the quote followed by the remainder of the line. I don't know what actual tokens are passed to the compiler without the-E
switch.pcpp
fails to match the regex and produces a token for just the quote character, then tokenizes the rest of the line. In order to keep a program which is using the tokens produced bypcpp
from getting confused, I think that an error should be generated. Perhaps a character or string literal token should be produced as though the missing terminator appeared at the end of the line.