{"action":"created","comment":{"url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/comments/41840181","id":41840181,"diff_hunk":"@@ -0,0 +1,213 @@\n+/***********************************************************************************************************************\n+ **\n+ ** Copyright (c) 2011, 2015 ETH Zurich\n+ ** All rights reserved.\n+ **\n+ ** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the\n+ ** following conditions are met:\n+ **\n+ **    * Redistributions of source code must retain the above copyright notice, this list of conditions and the\n+ **      following disclaimer.\n+ **    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the\n+ **      following disclaimer in the documentation and/or other materials provided with the distribution.\n+ **    * Neither the name of the ETH Zurich nor the names of its contributors may be used to endorse or promote products\n+ **      derived from this software without specific prior written permission.\n+ **\n+ **\n+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n+ ** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n+ ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n+ ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ **\n+ **********************************************************************************************************************/\n+\n+#include \"ExpansionManager.h\"\n+\n+#include \"MacroImportHelper.h\"\n+#include \"StaticStuff.h\"\n+\n+namespace CppImport {\n+\n+ExpansionManager::ExpansionManager(ClangHelper* clang, AstMapping* astMapping, DefinitionManager* definitionManager,\n+\t\t\t\t\t\t\t\t\t\t\t  LexicalHelper* lexicalHelper)\n+\t: clang_(clang), astMapping_(astMapping), definitionManager_(definitionManager), lexicalHelper_(lexicalHelper) {}\n+\n+void ExpansionManager::addMacroExpansion(clang::SourceRange sr,\n+\t\t\t\t\t\t\t\t\t\t\t\t\t  const clang::MacroDirective* md, const clang::MacroArgs* args)\n+{\n+\tif (definitionManager_->isPartialEnd(md))\n+\t{\n+\t\t/*\n+\t\t * if the to be registered expansion's definition is a partial end macro then we are not going to generate a\n+\t\t * meta definition for this expansion.\n+\t\t * instead we remember that we are currently not in an xMacro body.\n+\t\t */\n+\t\tcurrentXMacroParent = nullptr;\n+\t\treturn;\n+\t}\n+\n+\t// build new macro expansion entry from the provided information\n+\tauto entry = new MacroExpansion();\n+\tentry->range = sr;\n+\tentry->definition = md;\n+\tentry->parent = expansion(sr.getBegin());\n+\tif (entry->parent) entry->parent->children.append(entry);\n+\n+\t// handle xMacro data members\n+\tif (definitionManager_->isPartialBegin(md) && !currentXMacroParent)\n+\t\t/*\n+\t\t * if the definition of this expansion is a partial begin macro we remember that we are now in a xMacro body.\n+\t\t * we check whether we are not already in a xMacro body because we want to remember the .h part (the first one) of\n+\t\t * the xMacro begins (the potential .cpp part could overwrite the stored information otherwise).\n+\t\t */\n+\t\tcurrentXMacroParent = entry;\n+\telse if (currentXMacroParent && !entry->parent)\n+\t{\n+\t\t/*\n+\t\t * if we are in a xMacro body and the current expansion is not a top level expansion then this expansion is a\n+\t\t * xMacro child of the stored xMacro expansion.\n+\t\t */\n+\t\tentry->xMacroParent = currentXMacroParent;\n+\t\tcurrentXMacroParent->xMacroChildren.append(entry);\n+\t}\n+\n+\tentry->metaCall =\n+\t\t\tnew OOModel::MetaCallExpression(definitionManager_->definitionName(entry->definition));\n+\n+\tif (!md->getMacroInfo()->isObjectLike()) // only function like macros have braces in their signature to parse\n+\t{\n+\t\t// extract everything in parentheses of the expansion signature using a regular expression\n+\t\tQRegularExpression regex (\"\\\\((.*)\\\\)\", QRegularExpression::DotMatchesEverythingOption);\n+\t\tauto argumentsString = lexicalHelper_->unexpandedSpelling(sr);\n+\t\tauto match = regex.match(argumentsString);\n+\t\tauto arguments = match.captured(1).split(\",\");\n+\n+\t\t// by default initialize meta call arguments to be reference expressions with the raw spelling at this expansion\n+\t\tfor (auto i = 0; i < clang_->argumentNames(entry->definition).size(); i++)\n+\t\t{\n+\t\t\tauto actualArg = args->getUnexpArgument((unsigned int)i);\n+\t\t\tentry->metaCall->arguments()->append(new OOModel::ReferenceExpression(arguments[i]));\n+\t\t\tentry->argumentLocs.append(actualArg->getLocation());\n+\t\t}\n+\t}\n+\n+\texpansions_.append(entry);\n+}\n+\n+QVector<MacroExpansion*> ExpansionManager::expansions() { return expansions_; }","path":"CppImport/src/macro/ExpansionManager.cpp","position":100,"original_position":100,"commit_id":"bff55163b66efcda18af58130d7cef4ea119894f","original_commit_id":"bff55163b66efcda18af58130d7cef4ea119894f","user":{"login":"dimitar-asenov","id":1152976,"avatar_url":"https://avatars.githubusercontent.com/u/1152976?v=3","gravatar_id":"","url":"https://api.github.com/users/dimitar-asenov","html_url":"https://github.com/dimitar-asenov","followers_url":"https://api.github.com/users/dimitar-asenov/followers","following_url":"https://api.github.com/users/dimitar-asenov/following{/other_user}","gists_url":"https://api.github.com/users/dimitar-asenov/gists{/gist_id}","starred_url":"https://api.github.com/users/dimitar-asenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimitar-asenov/subscriptions","organizations_url":"https://api.github.com/users/dimitar-asenov/orgs","repos_url":"https://api.github.com/users/dimitar-asenov/repos","events_url":"https://api.github.com/users/dimitar-asenov/events{/privacy}","received_events_url":"https://api.github.com/users/dimitar-asenov/received_events","type":"User","site_admin":false},"body":"inline","created_at":"2015-10-13T08:39:09Z","updated_at":"2015-10-13T08:39:09Z","html_url":"https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41840181","pull_request_url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167","_links":{"self":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/comments/41840181"},"html":{"href":"https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41840181"},"pull_request":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167"}}},"pull_request":{"url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167","id":47412063,"html_url":"https://github.com/dimitar-asenov/Envision/pull/167","diff_url":"https://github.com/dimitar-asenov/Envision/pull/167.diff","patch_url":"https://github.com/dimitar-asenov/Envision/pull/167.patch","issue_url":"https://api.github.com/repos/dimitar-asenov/Envision/issues/167","number":167,"state":"open","locked":false,"title":"Macro Import","user":{"login":"patrick-luethi","id":6049349,"avatar_url":"https://avatars.githubusercontent.com/u/6049349?v=3","gravatar_id":"","url":"https://api.github.com/users/patrick-luethi","html_url":"https://github.com/patrick-luethi","followers_url":"https://api.github.com/users/patrick-luethi/followers","following_url":"https://api.github.com/users/patrick-luethi/following{/other_user}","gists_url":"https://api.github.com/users/patrick-luethi/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick-luethi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick-luethi/subscriptions","organizations_url":"https://api.github.com/users/patrick-luethi/orgs","repos_url":"https://api.github.com/users/patrick-luethi/repos","events_url":"https://api.github.com/users/patrick-luethi/events{/privacy}","received_events_url":"https://api.github.com/users/patrick-luethi/received_events","type":"User","site_admin":false},"body":"<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23issuecomment-147376852%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41833923%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41833977%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834062%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834146%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834231%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834426%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834710%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835193%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835265%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835315%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835326%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835331%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835344%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835352%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835360%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835604%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835620%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835680%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835853%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835959%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836041%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836048%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836065%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836068%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836272%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836373%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836454%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836552%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836602%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836771%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837040%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837055%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837160%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837177%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837216%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837237%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837334%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837496%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837714%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837824%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837852%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837946%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838087%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838204%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838266%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838335%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838858%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839075%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839118%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839604%22%2C%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839904%22%5D%2C%20%22comments%22%3A%20%7B%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2046%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836068%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A50%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.h%2052%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834426%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Instead%20of%20using%20a%20QHash%20with%20a%20vector%20value%2C%20why%20not%20use%20a%20QMultiHash%2C%20which%20was%20designed%20specifically%20for%20your%20use%20case%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A32%3A59Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.h%3AL1-57%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2041%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836065%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A50%3A21Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2066%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836373%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22ugh.%20catch%20ALL%20exceptions%20and%20return%20a%20string%20%3F%20really%3F%20what%20if%20there%20was%20an%20out%20of%20memory%20exception%3F%20Surely%20there%20is%20a%20more%20limited%20set%20of%20exceptions%20that%20you%20want%20to%20silence%20here.%20But%20I%27m%20not%20fond%20of%20this%20error%20mechanism.%20We%20should%20talk%20about%20it.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A54%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2041%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838266%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20add%20a%20class%20description.%20Brief%20descriptions%20are%20alright.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A19%3A52Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2062%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835265%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Unlike%20above%2C%20here%20you%20check%20for%20duplicate%20entries%20and%20avoid%20them.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A41%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2067%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838858%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%3A%29%20Terrible%20name.%20But%20more%20importantly%20%28and%20will%20fix%20the%20name%29%2C%20it%20seems%20fishy%20that%20this%20method%20is%20here.%20Instead%20of%20%5Cr%5Cn%20%20%20%20%5Cr%5Cn%20%20%20%20expansionManager.tLExpansionTLNodes%28someExpansion%29%5Cr%5Cn%5Cr%5CnI%20would%20expect%20to%20see%20the%20much%20nicer%3A%5Cr%5Cn%5Cr%5Cn%20%20%20%20someExpansion-%3EtopLevelNodes%28%29%5Cr%5Cn%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A26%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2063%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837946%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Don%27t%20abbreviate.%5Cr%5Cn%5Cr%5CnPlease%20look%20at%20all%20the%20code%20to%20find%20such%20instances.%20From%20now%2C%20on%20when%20I%20see%20things%20like%20this%2C%20I%20will%20mark%20with%20just%20%5C%22name%5C%22.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A15%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2042%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835331%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A42%3A09Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/ClangAstConsumer.cpp%2020%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834062%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Why%20did%20you%20move%20this%20method%20to%20the%20end%20of%20the%20file%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A27%3A10Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/ClangAstConsumer.cpp%3AL41-52%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/ClangAstConsumer.cpp%2024%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834146%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22In%20general%2C%20you%20should%20use%20verbs%20for%20method%20names.%20Here%2C%20without%20having%20read%20the%20rest%20of%20the%20code%2C%20I%20feel%20like%20%60generateMacros%60%20is%20more%20appropriate%2C%20or%20perhaps%20even%20%60generateMetaCodeFromMacros%60%2C%20depending%20on%20what%20you%27re%20doing.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A28%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/ClangAstConsumer.cpp%3AL41-52%22%7D%2C%20%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23issuecomment-147376852%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Wow%2C%20no%20way%2C%20the%20PR%20is%20finally%20here.%20It%27s%20huge.%22%2C%20%22created_at%22%3A%20%222015-10-12T12%3A06%3A12Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.h%2045%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835853%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Don%27t%20be%20lazy%2C%20use%20%60Location%60%20instead%20of%20%60Loc%60.%20In%20general%2C%20don%27t%20abbreviate%20in%20method%20names.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A47%3A54Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.h%3AL1-59%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2094%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836602%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Is%20this%20loop%20guaranteed%20to%20terminate%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A57%3A29Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.h%2041%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837334%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Usually%2C%20you%20should%20take%20QString%20arguments%20as%20%60const%20QString%26%60%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A07%3A38Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.h%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/CppImportManager.cpp%205%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834231%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%60finalize%60%20%3F%20finalize%20what%3F%20This%20reads%20a%20bit%20like%20java.%20Give%20it%20a%20more%20descriptive%20name.%20I%27m%20not%20sure%20what%20this%20does%20exactly%2C%20but%20perhaps%20%60finalizeGeneration%60%20or%20%60finalizeMacrosInScope%60%20or%20something%20else%20is%20better.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A30%3A04Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/CppImportManager.cpp%3AL78-87%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2055%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837852%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A14%3A17Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2062%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838335%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Shouldn%27t%20this%20method%20be%20called%20%60expansions%60%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A20%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2098%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837496%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Wow%2C%20that%27s%20quite%20a%20heavy%20hash%20method.%20Are%20you%20sure%20we%20need%20it%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A10%3A11Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.cpp%2038%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839904%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22please%20use%20full%20names%20for%20the%20variables%2C%20it%27s%20hard%20to%20read%20the%20code%20below%20otherwise.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A36%3A35Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.cpp%3AL1-214%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%20121%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837177%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A05%3A21Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2077%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839118%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22default%20initialize%20all%20primitive%20fields%20with%20%7B%7D%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A28%3A41Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2090%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837055%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22MacroFileID%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A03%3A36Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2070%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836552%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22variable%2C%20field%2C%20and%20method%20names%20should%20start%20with%20a%20lowercase%20letter.%20Also%20here%20you%20can%20easily%20use%20%60location%60%20instead%20of%20%60Loc%60.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A56%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2076%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836771%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22please%20use%20better%20variable%20names.%20%60fileID%60%20is%20much%20better%20than%20the%20cryptic%20%60FID%60%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A59%3A53Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2072%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839075%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22So%20connecting%20to%20the%20previous%20comment%2C%20it%20seems%20not%20so%20nice%20that%20whoever%20is%20using%20an%20expansion%20will%20have%20to%20know%20whether%20it%20is%20a%20top-level%20one%2C%20or%20if%20it%20could%20be%20a%20child%20of%20another%20expansion.%5Cr%5Cn%5Cr%5CnIdeally%2C%20there%20is%20only%20one%20public%20method%20in%20%60MacroExpansion%60%20that%20returns%20the%20top-level%20nodes.%20Then%20that%20method%20should%20be%20able%20to%20figure%20it%20out%20whether%20this%20is%20a%20top-level%20expansion%20or%20not.%20Perhaps%20you%20can%20extend%20the%20expansion%20class%20to%20include%20this%20information.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A28%3A20Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2074%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836454%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%60while%28true%29%60%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A55%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.h%2036%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837216%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Please%20put%20a%20class%20description%20comment.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A05%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.h%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2058%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836272%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Errr.%20Returning%20an%20error%20string%3F%20Really%3F%20Is%20this%20error%20expected%20every%20now%20and%20then%3F%20If%20not%2C%20the%20use%20%60Q_ASSERT%60.%20If%20yes%2C%20then%20it%27s%20not%20really%20an%20error%20and%20we%20should%20probably%20handle%20it%20differently.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A53%3A15Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/CppImport.pro%2028%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41833977%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%60StaticStuff%60%20%3F%20surely%20we%20can%20come%20up%20with%20a%20more%20descriptive%20name.%20%3A%29%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A25%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/CppImport.pro%3AL53-74%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ExpansionManager.h%2034%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41839604%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22This%20is%20not%20an%20Envision%20file%2C%20is%20it%3F%20It%20should%20be%20put%20in%20%60precompiled.h%60%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A33%3A38Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ExpansionManager.h%3AL1-93%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2036%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836048%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A50%3A12Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2074%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835344%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A42%3A16Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2076%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835352%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%20and%20make%20const%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A42%3A24Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2031%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41836041%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A50%3A06Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2035%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41834710%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%27m%20not%20sure%20if%20the%20compiler%20will%20properly%20detect%20this%20tail%20recursion%2C%20to%20make%20sure%20it%20does%2C%20you%20can%20check%20here%20is%20there%20is%20no%20parent%20and%20if%20so%20return%20%60nullptr%60.%20Then%20as%20the%20next%20statement%2C%20without%20an%20if%2C%20just%20call%20the%20function%20recursively.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A35%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2033%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837714%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A12%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2078%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838087%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Could%20you%20please%20extract%20these%20mappings%2C%20into%20a%20static%20field%2C%20initialized%20at%20the%20beginning%20of%20the%20file%3F%20That%20way%20the%20functional%20code%20will%20be%20nicer%20and%20generic%2C%20only%20the%20map%20will%20be%20Envision%20specific.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A17%3A42Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2040%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835326%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A42%3A04Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.h%2053%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835604%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Always%20default%20initialize%20primitive%20values%20%28int%2C%20bool%2C%20pointers%2C%20enums%29%20with%20%60fieldName_%7B%7D%3B%60%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A44%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.h%3AL1-59%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%2086%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837040%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22SpellingLocation%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A03%3A19Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.h%2033%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835680%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22It%20would%20be%20nice%20if%20some%20of%20the%20less%20straight-forward%20classes%20had%20a%20comment%20describing%20what%20the%20class%20is%20for.%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A45%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%2C%20%7B%22body%22%3A%20%22A%20few%20questions%3A%5Cr%5Cn-%20Is%20this%20class%20just%20a%20collection%20or%20unrelated%20methods%3F%5Cr%5Cn-%20Why%20not%20make%20more%20methods%20static%3F%5Cr%5Cn-%20Could%20this%20be%20a%20singleton%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A49%3A15Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.h%3AL1-59%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2044%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835193%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22If%20we%20attempt%20to%20add%20an%20identical%20mapping%20twice%2C%20we%20will%20indeed%20get%20two%20entries%20in%20%60astMapping_%5BenvisionAstNode%5D%60%20that%20have%20the%20same%20value.%20Is%20that%20a%20problem%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A40%3A58Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%2040%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837824%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22This%20method%20searches%20for%20the%20definition%20twice.%20To%20make%20it%20better%20use%20the%20%60definitions_.find%28%29%60%20method%20and%20avoid%20the%20redundant%20search.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A13%3A56Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.h%2073%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837237%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22default%20initialize%20with%20%7B%7D%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A06%3A08Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.h%3AL1-79%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.h%2054%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835620%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22default%20initialize%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A44%3A41Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.h%3AL1-59%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/DefinitionManager.cpp%20115%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41838204%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Change%20this%20string%20to%20%60%5C%22ExternalMacro%5C%22%60.%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A19%3A07Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/DefinitionManager.cpp%3AL1-119%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/ClangHelper.cpp%20115%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41837160%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22can%27t%20you%20use%20the%20range%20based%20for%20here%3F%22%2C%20%22created_at%22%3A%20%222015-10-13T08%3A05%3A07Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/ClangHelper.cpp%3AL1-127%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/CppImport.pro%2016%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41833923%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22It%27s%20a%20minor%20thing%2C%20but%20could%20you%20please%20change%20the%20indentation%20to%20match%20the%20rest%20of%20the%20file%20%28spaces%20instead%20of%20tabs%29%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A24%3A51Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/CppImport.pro%3AL53-74%22%7D%2C%20%22Pull%20bff55163b66efcda18af58130d7cef4ea119894f%20CppImport/src/macro/AstMapping.cpp%2066%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov/Envision/pull/167%23discussion_r41835315%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22inline%20in%20h%20file%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A41%3A55Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%2C%20%7B%22body%22%3A%20%22also%20make%20const%22%2C%20%22created_at%22%3A%20%222015-10-13T07%3A42%3A35Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1152976%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dimitar-asenov%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20CppImport/src/macro/AstMapping.cpp%3AL1-79%22%7D%7D%7D'></a>\n<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>\n- [ ] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#issuecomment-147376852'>General Comment</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Wow, no way, the PR is finally here. It's huge.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/CppImport.pro 16'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41833923'>File: CppImport/CppImport.pro:L53-74</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> It's a minor thing, but could you please change the indentation to match the rest of the file (spaces instead of tabs)\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/CppImport.pro 28'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41833977'>File: CppImport/CppImport.pro:L53-74</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> `StaticStuff` ? surely we can come up with a more descriptive name. :)\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/ClangAstConsumer.cpp 20'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41834062'>File: CppImport/src/ClangAstConsumer.cpp:L41-52</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Why did you move this method to the end of the file?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/ClangAstConsumer.cpp 24'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41834146'>File: CppImport/src/ClangAstConsumer.cpp:L41-52</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> In general, you should use verbs for method names. Here, without having read the rest of the code, I feel like `generateMacros` is more appropriate, or perhaps even `generateMetaCodeFromMacros`, depending on what you're doing.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/CppImportManager.cpp 5'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41834231'>File: CppImport/src/CppImportManager.cpp:L78-87</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> `finalize` ? finalize what? This reads a bit like java. Give it a more descriptive name. I'm not sure what this does exactly, but perhaps `finalizeGeneration` or `finalizeMacrosInScope` or something else is better.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.h 52'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41834426'>File: CppImport/src/macro/AstMapping.h:L1-57</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Instead of using a QHash with a vector value, why not use a QMultiHash, which was designed specifically for your use case?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 35'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41834710'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> I'm not sure if the compiler will properly detect this tail recursion, to make sure it does, you can check here is there is no parent and if so return `nullptr`. Then as the next statement, without an if, just call the function recursively.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 44'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835193'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> If we attempt to add an identical mapping twice, we will indeed get two entries in `astMapping_[envisionAstNode]` that have the same value. Is that a problem?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 62'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835265'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Unlike above, here you check for duplicate entries and avoid them.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 66'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835315'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline in h file\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> also make const\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 40'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835326'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 42'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835331'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 74'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835344'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/AstMapping.cpp 76'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835352'>File: CppImport/src/macro/AstMapping.cpp:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline and make const\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.h 53'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835604'>File: CppImport/src/macro/ClangHelper.h:L1-59</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Always default initialize primitive values (int, bool, pointers, enums) with `fieldName_{};`\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.h 54'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835620'>File: CppImport/src/macro/ClangHelper.h:L1-59</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> default initialize\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.h 33'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835680'>File: CppImport/src/macro/ClangHelper.h:L1-59</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> It would be nice if some of the less straight-forward classes had a comment describing what the class is for.\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> A few questions:\n- Is this class just a collection or unrelated methods?\n- Why not make more methods static?\n- Could this be a singleton?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.h 45'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41835853'>File: CppImport/src/macro/ClangHelper.h:L1-59</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Don't be lazy, use `Location` instead of `Loc`. In general, don't abbreviate in method names.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 31'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836041'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 36'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836048'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 41'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836065'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 46'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836068'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 58'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836272'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Errr. Returning an error string? Really? Is this error expected every now and then? If not, the use `Q_ASSERT`. If yes, then it's not really an error and we should probably handle it differently.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 66'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836373'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> ugh. catch ALL exceptions and return a string ? really? what if there was an out of memory exception? Surely there is a more limited set of exceptions that you want to silence here. But I'm not fond of this error mechanism. We should talk about it.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 74'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836454'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> `while(true)`\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 70'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836552'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> variable, field, and method names should start with a lowercase letter. Also here you can easily use `location` instead of `Loc`.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 94'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836602'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Is this loop guaranteed to terminate?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 76'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41836771'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> please use better variable names. `fileID` is much better than the cryptic `FID`\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 86'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837040'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> SpellingLocation\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 90'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837055'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> MacroFileID\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 115'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837160'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> can't you use the range based for here?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ClangHelper.cpp 121'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837177'>File: CppImport/src/macro/ClangHelper.cpp:L1-127</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.h 36'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837216'>File: CppImport/src/macro/DefinitionManager.h:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Please put a class description comment.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.h 73'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837237'>File: CppImport/src/macro/DefinitionManager.h:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> default initialize with {}\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.h 41'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837334'>File: CppImport/src/macro/DefinitionManager.h:L1-79</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Usually, you should take QString arguments as `const QString&`\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 98'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837496'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Wow, that's quite a heavy hash method. Are you sure we need it?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 33'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837714'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 40'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837824'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> This method searches for the definition twice. To make it better use the `definitions_.find()` method and avoid the redundant search.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 55'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837852'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> inline\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 63'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41837946'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Don't abbreviate.\nPlease look at all the code to find such instances. From now, on when I see things like this, I will mark with just \"name\".\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 78'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41838087'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Could you please extract these mappings, into a static field, initialized at the beginning of the file? That way the functional code will be nicer and generic, only the map will be Envision specific.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/DefinitionManager.cpp 115'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41838204'>File: CppImport/src/macro/DefinitionManager.cpp:L1-119</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Change this string to `\"ExternalMacro\"`.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 41'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41838266'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Please add a class description. Brief descriptions are alright.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 62'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41838335'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> Shouldn't this method be called `expansions`?\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 67'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41838858'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> :) Terrible name. But more importantly (and will fix the name), it seems fishy that this method is here. Instead of\nexpansionManager.tLExpansionTLNodes(someExpansion)\nI would expect to see the much nicer:\nsomeExpansion->topLevelNodes()\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 72'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41839075'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> So connecting to the previous comment, it seems not so nice that whoever is using an expansion will have to know whether it is a top-level one, or if it could be a child of another expansion.\nIdeally, there is only one public method in `MacroExpansion` that returns the top-level nodes. Then that method should be able to figure it out whether this is a top-level expansion or not. Perhaps you can extend the expansion class to include this information.\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 77'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41839118'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> default initialize all primitive fields with {}\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.h 34'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41839604'>File: CppImport/src/macro/ExpansionManager.h:L1-93</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> This is not an Envision file, is it? It should be put in `precompiled.h`\n- [ ] <a href='#crh-comment-Pull bff55163b66efcda18af58130d7cef4ea119894f CppImport/src/macro/ExpansionManager.cpp 38'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/dimitar-asenov/Envision/pull/167#discussion_r41839904'>File: CppImport/src/macro/ExpansionManager.cpp:L1-214</a></b>\n- <a href='https://github.com/dimitar-asenov'><img border=0 src='https://avatars.githubusercontent.com/u/1152976?v=3' height=16 width=16'></a> please use full names for the variables, it's hard to read the code below otherwise.\n\n\n<a href='https://www.codereviewhub.com/dimitar-asenov/Envision/pull/167?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/dimitar-asenov/Envision/pull/167?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://github.com/dimitar-asenov/Envision/pull/167'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>\n<a href='#crh-end'></a>","created_at":"2015-10-12T12:04:56Z","updated_at":"2015-10-13T08:39:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad01a96a990ebcc683fcb25ea33de48c1be57948","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167/commits","review_comments_url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167/comments","review_comment_url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimitar-asenov/Envision/issues/167/comments","statuses_url":"https://api.github.com/repos/dimitar-asenov/Envision/statuses/bff55163b66efcda18af58130d7cef4ea119894f","head":{"label":"patrick-luethi:MacroImport","ref":"MacroImport","sha":"bff55163b66efcda18af58130d7cef4ea119894f","user":{"login":"patrick-luethi","id":6049349,"avatar_url":"https://avatars.githubusercontent.com/u/6049349?v=3","gravatar_id":"","url":"https://api.github.com/users/patrick-luethi","html_url":"https://github.com/patrick-luethi","followers_url":"https://api.github.com/users/patrick-luethi/followers","following_url":"https://api.github.com/users/patrick-luethi/following{/other_user}","gists_url":"https://api.github.com/users/patrick-luethi/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick-luethi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick-luethi/subscriptions","organizations_url":"https://api.github.com/users/patrick-luethi/orgs","repos_url":"https://api.github.com/users/patrick-luethi/repos","events_url":"https://api.github.com/users/patrick-luethi/events{/privacy}","received_events_url":"https://api.github.com/users/patrick-luethi/received_events","type":"User","site_admin":false},"repo":{"id":15878040,"name":"Envision","full_name":"patrick-luethi/Envision","owner":{"login":"patrick-luethi","id":6049349,"avatar_url":"https://avatars.githubusercontent.com/u/6049349?v=3","gravatar_id":"","url":"https://api.github.com/users/patrick-luethi","html_url":"https://github.com/patrick-luethi","followers_url":"https://api.github.com/users/patrick-luethi/followers","following_url":"https://api.github.com/users/patrick-luethi/following{/other_user}","gists_url":"https://api.github.com/users/patrick-luethi/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick-luethi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick-luethi/subscriptions","organizations_url":"https://api.github.com/users/patrick-luethi/orgs","repos_url":"https://api.github.com/users/patrick-luethi/repos","events_url":"https://api.github.com/users/patrick-luethi/events{/privacy}","received_events_url":"https://api.github.com/users/patrick-luethi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/patrick-luethi/Envision","description":"A next generation IDE with a visual programming interface","fork":true,"url":"https://api.github.com/repos/patrick-luethi/Envision","forks_url":"https://api.github.com/repos/patrick-luethi/Envision/forks","keys_url":"https://api.github.com/repos/patrick-luethi/Envision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patrick-luethi/Envision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patrick-luethi/Envision/teams","hooks_url":"https://api.github.com/repos/patrick-luethi/Envision/hooks","issue_events_url":"https://api.github.com/repos/patrick-luethi/Envision/issues/events{/number}","events_url":"https://api.github.com/repos/patrick-luethi/Envision/events","assignees_url":"https://api.github.com/repos/patrick-luethi/Envision/assignees{/user}","branches_url":"https://api.github.com/repos/patrick-luethi/Envision/branches{/branch}","tags_url":"https://api.github.com/repos/patrick-luethi/Envision/tags","blobs_url":"https://api.github.com/repos/patrick-luethi/Envision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patrick-luethi/Envision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patrick-luethi/Envision/git/refs{/sha}","trees_url":"https://api.github.com/repos/patrick-luethi/Envision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patrick-luethi/Envision/statuses/{sha}","languages_url":"https://api.github.com/repos/patrick-luethi/Envision/languages","stargazers_url":"https://api.github.com/repos/patrick-luethi/Envision/stargazers","contributors_url":"https://api.github.com/repos/patrick-luethi/Envision/contributors","subscribers_url":"https://api.github.com/repos/patrick-luethi/Envision/subscribers","subscription_url":"https://api.github.com/repos/patrick-luethi/Envision/subscription","commits_url":"https://api.github.com/repos/patrick-luethi/Envision/commits{/sha}","git_commits_url":"https://api.github.com/repos/patrick-luethi/Envision/git/commits{/sha}","comments_url":"https://api.github.com/repos/patrick-luethi/Envision/comments{/number}","issue_comment_url":"https://api.github.com/repos/patrick-luethi/Envision/issues/comments{/number}","contents_url":"https://api.github.com/repos/patrick-luethi/Envision/contents/{+path}","compare_url":"https://api.github.com/repos/patrick-luethi/Envision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patrick-luethi/Envision/merges","archive_url":"https://api.github.com/repos/patrick-luethi/Envision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patrick-luethi/Envision/downloads","issues_url":"https://api.github.com/repos/patrick-luethi/Envision/issues{/number}","pulls_url":"https://api.github.com/repos/patrick-luethi/Envision/pulls{/number}","milestones_url":"https://api.github.com/repos/patrick-luethi/Envision/milestones{/number}","notifications_url":"https://api.github.com/repos/patrick-luethi/Envision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patrick-luethi/Envision/labels{/name}","releases_url":"https://api.github.com/repos/patrick-luethi/Envision/releases{/id}","created_at":"2014-01-13T18:54:31Z","updated_at":"2014-05-27T10:10:38Z","pushed_at":"2015-10-12T17:28:31Z","git_url":"git://github.com/patrick-luethi/Envision.git","ssh_url":"git@github.com:patrick-luethi/Envision.git","clone_url":"https://github.com/patrick-luethi/Envision.git","svn_url":"https://github.com/patrick-luethi/Envision","homepage":"http://dimitar-asenov.github.com/Envision/","size":31289,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"SemanticZoom"}},"base":{"label":"dimitar-asenov:development","ref":"development","sha":"df85075fc874095101d75f78d866c450d577a586","user":{"login":"dimitar-asenov","id":1152976,"avatar_url":"https://avatars.githubusercontent.com/u/1152976?v=3","gravatar_id":"","url":"https://api.github.com/users/dimitar-asenov","html_url":"https://github.com/dimitar-asenov","followers_url":"https://api.github.com/users/dimitar-asenov/followers","following_url":"https://api.github.com/users/dimitar-asenov/following{/other_user}","gists_url":"https://api.github.com/users/dimitar-asenov/gists{/gist_id}","starred_url":"https://api.github.com/users/dimitar-asenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimitar-asenov/subscriptions","organizations_url":"https://api.github.com/users/dimitar-asenov/orgs","repos_url":"https://api.github.com/users/dimitar-asenov/repos","events_url":"https://api.github.com/users/dimitar-asenov/events{/privacy}","received_events_url":"https://api.github.com/users/dimitar-asenov/received_events","type":"User","site_admin":false},"repo":{"id":2650576,"name":"Envision","full_name":"dimitar-asenov/Envision","owner":{"login":"dimitar-asenov","id":1152976,"avatar_url":"https://avatars.githubusercontent.com/u/1152976?v=3","gravatar_id":"","url":"https://api.github.com/users/dimitar-asenov","html_url":"https://github.com/dimitar-asenov","followers_url":"https://api.github.com/users/dimitar-asenov/followers","following_url":"https://api.github.com/users/dimitar-asenov/following{/other_user}","gists_url":"https://api.github.com/users/dimitar-asenov/gists{/gist_id}","starred_url":"https://api.github.com/users/dimitar-asenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimitar-asenov/subscriptions","organizations_url":"https://api.github.com/users/dimitar-asenov/orgs","repos_url":"https://api.github.com/users/dimitar-asenov/repos","events_url":"https://api.github.com/users/dimitar-asenov/events{/privacy}","received_events_url":"https://api.github.com/users/dimitar-asenov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dimitar-asenov/Envision","description":"A next generation IDE with a visual programming interface","fork":false,"url":"https://api.github.com/repos/dimitar-asenov/Envision","forks_url":"https://api.github.com/repos/dimitar-asenov/Envision/forks","keys_url":"https://api.github.com/repos/dimitar-asenov/Envision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimitar-asenov/Envision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimitar-asenov/Envision/teams","hooks_url":"https://api.github.com/repos/dimitar-asenov/Envision/hooks","issue_events_url":"https://api.github.com/repos/dimitar-asenov/Envision/issues/events{/number}","events_url":"https://api.github.com/repos/dimitar-asenov/Envision/events","assignees_url":"https://api.github.com/repos/dimitar-asenov/Envision/assignees{/user}","branches_url":"https://api.github.com/repos/dimitar-asenov/Envision/branches{/branch}","tags_url":"https://api.github.com/repos/dimitar-asenov/Envision/tags","blobs_url":"https://api.github.com/repos/dimitar-asenov/Envision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimitar-asenov/Envision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimitar-asenov/Envision/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimitar-asenov/Envision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimitar-asenov/Envision/statuses/{sha}","languages_url":"https://api.github.com/repos/dimitar-asenov/Envision/languages","stargazers_url":"https://api.github.com/repos/dimitar-asenov/Envision/stargazers","contributors_url":"https://api.github.com/repos/dimitar-asenov/Envision/contributors","subscribers_url":"https://api.github.com/repos/dimitar-asenov/Envision/subscribers","subscription_url":"https://api.github.com/repos/dimitar-asenov/Envision/subscription","commits_url":"https://api.github.com/repos/dimitar-asenov/Envision/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimitar-asenov/Envision/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimitar-asenov/Envision/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimitar-asenov/Envision/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimitar-asenov/Envision/contents/{+path}","compare_url":"https://api.github.com/repos/dimitar-asenov/Envision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimitar-asenov/Envision/merges","archive_url":"https://api.github.com/repos/dimitar-asenov/Envision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimitar-asenov/Envision/downloads","issues_url":"https://api.github.com/repos/dimitar-asenov/Envision/issues{/number}","pulls_url":"https://api.github.com/repos/dimitar-asenov/Envision/pulls{/number}","milestones_url":"https://api.github.com/repos/dimitar-asenov/Envision/milestones{/number}","notifications_url":"https://api.github.com/repos/dimitar-asenov/Envision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimitar-asenov/Envision/labels{/name}","releases_url":"https://api.github.com/repos/dimitar-asenov/Envision/releases{/id}","created_at":"2011-10-26T12:03:58Z","updated_at":"2015-10-12T12:09:33Z","pushed_at":"2015-10-13T08:25:39Z","git_url":"git://github.com/dimitar-asenov/Envision.git","ssh_url":"git@github.com:dimitar-asenov/Envision.git","clone_url":"https://github.com/dimitar-asenov/Envision.git","svn_url":"https://github.com/dimitar-asenov/Envision","homepage":"http://dimitar-asenov.github.com/Envision/","size":57628,"stargazers_count":20,"watchers_count":20,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":34,"forks":14,"open_issues":34,"watchers":20,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167"},"html":{"href":"https://github.com/dimitar-asenov/Envision/pull/167"},"issue":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/issues/167"},"comments":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/issues/167/comments"},"review_comments":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167/comments"},"review_comment":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/pulls/167/commits"},"statuses":{"href":"https://api.github.com/repos/dimitar-asenov/Envision/statuses/bff55163b66efcda18af58130d7cef4ea119894f"}}}}