|
|
|
|
@ -102,7 +102,21 @@ Ctags::Location Ctags::get_location(const std::string &line_, bool add_markup, b
|
|
|
|
|
auto symbol_end = line.find('\t'); |
|
|
|
|
if(symbol_end == std::string::npos) |
|
|
|
|
return location; |
|
|
|
|
location.symbol = line.substr(0, symbol_end); |
|
|
|
|
|
|
|
|
|
// Unescape symbol
|
|
|
|
|
if(symbol_end > 0) { |
|
|
|
|
location.symbol.reserve(symbol_end); |
|
|
|
|
bool escaped = false; |
|
|
|
|
for(size_t i = 0; i < symbol_end; ++i) { |
|
|
|
|
if(!escaped && line[i] == '\\') { |
|
|
|
|
escaped = true; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
escaped = false; |
|
|
|
|
location.symbol += line[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(9 < location.symbol.size() && location.symbol[8] == ' ' && starts_with(location.symbol, "operator")) { |
|
|
|
|
auto &chr = location.symbol[9]; |
|
|
|
|
if(!((chr >= 'A' && chr <= 'Z') || (chr >= 'a' && chr <= 'z') || (chr >= '0' && chr <= '9') || chr == '_' || chr == '$' || static_cast<unsigned char>(chr) >= 128)) |
|
|
|
|
|