#pragma once #include #include #include #include #include namespace NSQLHighlight { enum class EUnitKind { Keyword, Punctuation, QuotedIdentifier, BindParameterIdentifier, OptionIdentifier, TypeIdentifier, FunctionIdentifier, Identifier, Literal, StringLiteral, Comment, Whitespace, Error, }; struct TRangePattern { static constexpr const char* EmbeddedPythonBegin = "@@#py"; static constexpr const char* EmbeddedJavaScriptBegin = "@@//js"; TString BeginPlain; TString EndPlain; TMaybe EscapeRegex; }; // Range patterns are expected to be matched before others. struct TUnit { EUnitKind Kind; TVector RangePatterns; TVector Patterns; TMaybe> PatternsANSI; bool IsPlain = true; bool IsCodeGenExcluded = false; }; struct THighlighting { TString Name = "YQL"; TString Extension = "yql"; TVector Units; }; THighlighting MakeHighlighting(); THighlighting MakeHighlighting(const NSQLReflect::TLexerGrammar& grammar); } // namespace NSQLHighlight