aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/complete/antlr4/vocabulary.cpp
blob: 0938ae3aca0b849d9f0f2d5973e024818039c3b8 (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