summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/ide/completion/antlr4/vocabulary.cpp
blob: 318f98574564e0913f9e90735e7951d6e734a6c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "vocabulary.h"

namespace NSQLComplete {

std::string Display(const antlr4::dfa::Vocabulary& vocabulary, TTokenId tokenType) {
    auto name = vocabulary.getDisplayName(tokenType);
    if (2 <= name.length() && name.starts_with('\'') && name.ends_with('\'')) {
        name.erase(static_cast<std::string::size_type>(0), 1);
        name.pop_back();
    }
    return name;
}

} // namespace NSQLComplete