C++: clean up numeric literal parsing and add support for n3472.

Separate the messy pp-number parsing from the numeric literal parsing.
The C/C++ preprocessor makes a grown man cry, but at least we have
"proper" literal parsing when we want it, including C++1y binary
literals.

Next step is digit separators (n3781).

Change-Id: Ia069eef454ed5c056f77694a5b8a595d0b76adc4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Erik Verbruggen
2014-02-07 15:24:30 +01:00
committed by Nikolai Kosjar
parent 16becbd29c
commit 242b3f4110
6 changed files with 269 additions and 27 deletions

View File

@@ -51,6 +51,9 @@ public:
bool skipComments() const;
void setSkipComments(bool skipComments);
void setPreprocessorMode(bool ppMode)
{ _ppMode = ppMode; }
LanguageFeatures languageFeatures() const { return _languageFeatures; }
void setLanguageFeatures(LanguageFeatures features) { _languageFeatures = features; }
@@ -74,6 +77,7 @@ private:
LanguageFeatures _languageFeatures;
bool _skipComments: 1;
bool _endedJoined: 1;
bool _ppMode: 1;
};
} // namespace CPlusPlus