Commit b8ff60c0 authored by Ole Christian Eidheim's avatar Ole Christian Eidheim
Browse files

Improved Token::get_kind to make Structured binding declarations work properly

parent 2edcb84b
Pipeline #133583724 passed with stage
in 3 minutes and 49 seconds
......@@ -26,10 +26,10 @@ clangmm::Token::Kind clangmm::Token::get_kind() const {
bool clangmm::Token::is_identifier() const {
auto token_kind = get_kind();
auto cursor = get_cursor();
if(token_kind == clangmm::Token::Kind::Identifier && cursor.is_valid_kind())
if(token_kind == clangmm::Token::Kind::Identifier)
return true;
else if(token_kind == clangmm::Token::Kind::Keyword && cursor.is_valid_kind()) {
auto cursor = get_cursor();
if(token_kind == clangmm::Token::Kind::Keyword && cursor.is_valid_kind()) {
auto spelling = get_spelling();
if(spelling == "operator" || (spelling == "bool" && get_cursor().get_spelling() == "operator bool"))
return true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment