2018-01-06 21:22:22 +01:00
|
|
|
|
#include "PgKeywordList.h"
|
2018-12-23 08:39:38 +01:00
|
|
|
|
#include <unordered_set>
|
2018-01-06 21:22:22 +01:00
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
2018-12-23 08:39:38 +01:00
|
|
|
|
using KeywordHT = std::unordered_set<Keyword>;
|
2018-01-06 21:22:22 +01:00
|
|
|
|
|
2022-09-06 11:17:18 +00:00
|
|
|
|
#define PG_KEYWORD(a,b,c,d) Keyword{a,c},
|
2019-09-16 19:24:39 +02:00
|
|
|
|
const KeywordHT _ScanKeywords = {
|
2018-12-23 08:39:38 +01:00
|
|
|
|
//const Keyword _ScanKeywords[] = {
|
2022-09-06 11:17:18 +00:00
|
|
|
|
#include "kwlist.h"
|
2019-09-16 19:24:39 +02:00
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2018-01-06 21:22:22 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const Keyword* getPgsqlKeyword(QString s)
|
|
|
|
|
|
{
|
|
|
|
|
|
const Keyword *result = nullptr;
|
|
|
|
|
|
auto fr = _ScanKeywords.find(Keyword(s.toLower(), 0));
|
|
|
|
|
|
if (fr != _ScanKeywords.end())
|
|
|
|
|
|
result = &*fr;
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|