diff --git a/src/libclang/tokenizer.cpp b/src/libclang/tokenizer.cpp index 5e5642e..6218fc3 100644 --- a/src/libclang/tokenizer.cpp +++ b/src/libclang/tokenizer.cpp @@ -223,9 +223,15 @@ namespace || clang_isExpression(kind) || kind == CXCursor_CXXBaseSpecifier || kind == CXCursor_TemplateTypeParameter #endif - ) + ) // need to shrink range by one end = get_next_location(tu, file, end, -1); + else if (kind == CXCursor_UnexposedDecl) + { + // include semicolon, if necessary + if (token_after_is(tu, file, cur, end, ";")) + end = get_next_location(tu, file, end); + } return clang_getRange(begin, end); } diff --git a/src/libclang/variable_parser.cpp b/src/libclang/variable_parser.cpp index 89e00d4..d4a65bf 100644 --- a/src/libclang/variable_parser.cpp +++ b/src/libclang/variable_parser.cpp @@ -6,7 +6,6 @@ #include #include -#include #include "libclang_visitor.hpp"