summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/highlight/sql_highlight.h
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-05-12 13:53:24 +0300
committerrobot-piglet <[email protected]>2025-05-12 14:05:50 +0300
commit7a941ebd252fd7442b4d1d34d31d72e971ad20bf (patch)
tree70c132d1b611697ad23b90cf35215b035f247ec0 /yql/essentials/sql/v1/highlight/sql_highlight.h
parentbf1279129bcf6c1b1001e39c39a13d80737898d3 (diff)
Intermediate changes
commit_hash:3a624a323006078de71f50747f7b2e8cadba7ccd
Diffstat (limited to 'yql/essentials/sql/v1/highlight/sql_highlight.h')
-rw-r--r--yql/essentials/sql/v1/highlight/sql_highlight.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/yql/essentials/sql/v1/highlight/sql_highlight.h b/yql/essentials/sql/v1/highlight/sql_highlight.h
new file mode 100644
index 00000000000..f6ecc375836
--- /dev/null
+++ b/yql/essentials/sql/v1/highlight/sql_highlight.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <yql/essentials/sql/v1/lexer/regex/generic.h>
+#include <yql/essentials/sql/v1/reflect/sql_reflect.h>
+
+#include <util/generic/string.h>
+#include <util/generic/vector.h>
+#include <util/generic/map.h>
+
+namespace NSQLHighlight {
+
+ enum class EUnitKind {
+ Keyword,
+ Punctuation,
+ QuotedIdentifier,
+ BindParamterIdentifier,
+ TypeIdentifier,
+ FunctionIdentifier,
+ Identifier,
+ Literal,
+ StringLiteral,
+ Comment,
+ Whitespace,
+ Error,
+ };
+
+ struct TUnit {
+ EUnitKind Kind;
+ TVector<NSQLTranslationV1::TRegexPattern> Patterns;
+ TMaybe<TVector<NSQLTranslationV1::TRegexPattern>> PatternsANSI;
+ };
+
+ struct THighlighting {
+ TVector<TUnit> Units;
+ };
+
+ THighlighting MakeHighlighting();
+
+ THighlighting MakeHighlighting(const NSQLReflect::TLexerGrammar& grammar);
+
+} // namespace NSQLHighlight