Fix CPreprocessor uninitialised data causing error messages on "#endif" followed by EOF with no newline. Warn about unrecognised "#elif".
This was SVN commit r11418.
This commit is contained in:
parent
25762f1f0d
commit
3792b02963
@ -1131,8 +1131,14 @@ Done:
|
||||
rc = HandleElse (t, iLine);
|
||||
else if (IS_DIRECTIVE ("endif"))
|
||||
rc = HandleEndIf (t, iLine);
|
||||
|
||||
else
|
||||
{
|
||||
// elif is tricky to support because the EnableOutput stack doesn't
|
||||
// contain enough data to tell whether any previous branch matched
|
||||
if (IS_DIRECTIVE ("elif"))
|
||||
Error (iLine, "Unsupported preprocessor directive #elif");
|
||||
|
||||
//Error (iLine, "Unknown preprocessor directive", &iToken);
|
||||
//return Token (Token::TK_ERROR);
|
||||
|
||||
|
@ -108,10 +108,10 @@ class CPreprocessor
|
||||
/// Token length in bytes
|
||||
size_t Length;
|
||||
|
||||
Token () : Allocated (0), String (NULL)
|
||||
Token () : Type (TK_ERROR), Allocated (0), String (NULL), Length (0)
|
||||
{ }
|
||||
|
||||
Token (Kind iType) : Type (iType), Allocated (0), String (NULL)
|
||||
Token (Kind iType) : Type (iType), Allocated (0), String (NULL), Length (0)
|
||||
{ }
|
||||
|
||||
Token (Kind iType, const char *iString, size_t iLength) :
|
||||
|
Loading…
Reference in New Issue
Block a user