From 35488071ed2a15087ddca26f0a9c1a2c42b66eaa Mon Sep 17 00:00:00 2001 From: triton Date: Sun, 13 Apr 2014 18:03:18 +0100 Subject: [PATCH] Fixed preprocessed entities parsing in the new parser. --- src/CppParser/Parser.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 3441ce98..65242002 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -2102,6 +2102,17 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity( return nullptr; Entity->OriginalPtr = PPEntity; + Entity->_Namespace = GetTranslationUnit(PPEntity->getSourceRange().getBegin()); + + if (Decl->Kind == CppSharp::CppParser::AST::DeclarationKind::TranslationUnit) + { + Entity->_Namespace->PreprocessedEntities.push_back(Entity); + } + else + { + Decl->PreprocessedEntities.push_back(Entity); + } + Decl->PreprocessedEntities.push_back(Entity); return Entity;