123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666 |
- """
- pygments.lexers._qlik_builtins
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Qlik builtins.
- :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
- """
- # operators
- # see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/Operators/operators.htm
- OPERATORS_LIST = {
- "words": [
- # Bit operators
- "bitnot",
- "bitand",
- "bitor",
- "bitxor",
- # Logical operators
- "and",
- "or",
- "not",
- "xor",
- # Relational operators
- "precedes",
- "follows",
- # String operators
- "like",
- ],
- "symbols": [
- # Bit operators
- ">>",
- "<<",
- # Logical operators
- # Numeric operators
- "+",
- "-",
- "/",
- "*",
- # Relational operators
- "<",
- "<=",
- ">",
- ">=",
- "=",
- "<>",
- # String operators
- "&",
- ],
- }
- # SCRIPT STATEMENTS
- # see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/
- STATEMENT_LIST = [
- # control statements
- "for",
- "each",
- "in",
- "next",
- "do",
- "while",
- "until",
- "unless",
- "loop",
- "return",
- "switch",
- "case",
- "default",
- "if",
- "else",
- "endif",
- "then",
- "end",
- "exit",
- "script",
- "switch",
- # prefixes
- "Add",
- "Buffer",
- "Concatenate",
- "Crosstable",
- "First",
- "Generic",
- "Hierarchy",
- "HierarchyBelongsTo",
- "Inner",
- "IntervalMatch",
- "Join",
- "Keep",
- "Left",
- "Mapping",
- "Merge",
- "NoConcatenate",
- "Outer",
- "Partial reload",
- "Replace",
- "Right",
- "Sample",
- "Semantic",
- "Unless",
- "When",
- # regular statements
- "Alias", # alias ... as ...
- "as",
- "AutoNumber",
- "Binary",
- "Comment field", # comment fields ... using ...
- "Comment fields", # comment field ... with ...
- "using",
- "with",
- "Comment table", # comment table ... with ...
- "Comment tables", # comment tables ... using ...
- "Connect",
- "ODBC", # ODBC CONNECT TO ...
- "OLEBD", # OLEDB CONNECT TO ...
- "CUSTOM", # CUSTOM CONNECT TO ...
- "LIB", # LIB CONNECT TO ...
- "Declare",
- "Derive",
- "From",
- "explicit",
- "implicit",
- "Direct Query",
- "dimension",
- "measure",
- "Directory",
- "Disconnect",
- "Drop field",
- "Drop fields",
- "Drop table",
- "Drop tables",
- "Execute",
- "FlushLog",
- "Force",
- "capitalization",
- "case upper",
- "case lower",
- "case mixed",
- "Load",
- "distinct",
- "from",
- "inline",
- "resident",
- "from_field",
- "autogenerate",
- "extension",
- "where",
- "group by",
- "order by",
- "asc",
- "desc",
- "Let",
- "Loosen Table",
- "Map",
- "NullAsNull",
- "NullAsValue",
- "Qualify",
- "Rem",
- "Rename field",
- "Rename fields",
- "Rename table",
- "Rename tables",
- "Search",
- "include",
- "exclude",
- "Section",
- "access",
- "application",
- "Select",
- "Set",
- "Sleep",
- "SQL",
- "SQLColumns",
- "SQLTables",
- "SQLTypes",
- "Star",
- "Store",
- "Tag",
- "Trace",
- "Unmap",
- "Unqualify",
- "Untag",
- # Qualifiers
- "total",
- ]
- # Script functions
- # see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-scripts-chart-expressions.htm
- SCRIPT_FUNCTIONS = [
- # Basic aggregation functions in the data load script
- "FirstSortedValue",
- "Max",
- "Min",
- "Mode",
- "Only",
- "Sum",
- # Counter aggregation functions in the data load script
- "Count",
- "MissingCount",
- "NullCount",
- "NumericCount",
- "TextCount",
- # Financial aggregation functions in the data load script
- "IRR",
- "XIRR",
- "NPV",
- "XNPV",
- # Statistical aggregation functions in the data load script
- "Avg",
- "Correl",
- "Fractile",
- "FractileExc",
- "Kurtosis",
- "LINEST_B" "LINEST_df",
- "LINEST_f",
- "LINEST_m",
- "LINEST_r2",
- "LINEST_seb",
- "LINEST_sem",
- "LINEST_sey",
- "LINEST_ssreg",
- "Linest_ssresid",
- "Median",
- "Skew",
- "Stdev",
- "Sterr",
- "STEYX",
- # Statistical test functions
- "Chi2Test_chi2",
- "Chi2Test_df",
- "Chi2Test_p",
- # Two independent samples t-tests
- "ttest_conf",
- "ttest_df",
- "ttest_dif",
- "ttest_lower",
- "ttest_sig",
- "ttest_sterr",
- "ttest_t",
- "ttest_upper",
- # Two independent weighted samples t-tests
- "ttestw_conf",
- "ttestw_df",
- "ttestw_dif",
- "ttestw_lower",
- "ttestw_sig",
- "ttestw_sterr",
- "ttestw_t",
- "ttestw_upper",
- # One sample t-tests
- "ttest1_conf",
- "ttest1_df",
- "ttest1_dif",
- "ttest1_lower",
- "ttest1_sig",
- "ttest1_sterr",
- "ttest1_t",
- "ttest1_upper",
- # One weighted sample t-tests
- "ttest1w_conf",
- "ttest1w_df",
- "ttest1w_dif",
- "ttest1w_lower",
- "ttest1w_sig",
- "ttest1w_sterr",
- "ttest1w_t",
- "ttest1w_upper",
- # One column format functions
- "ztest_conf",
- "ztest_dif",
- "ztest_sig",
- "ztest_sterr",
- "ztest_z",
- "ztest_lower",
- "ztest_upper",
- # Weighted two-column format functions
- "ztestw_conf",
- "ztestw_dif",
- "ztestw_lower",
- "ztestw_sig",
- "ztestw_sterr",
- "ztestw_upper",
- "ztestw_z",
- # String aggregation functions in the data load script
- "Concat",
- "FirstValue",
- "LastValue",
- "MaxString",
- "MinString",
- # Synthetic dimension functions
- "ValueList",
- "ValueLoop",
- # Color functions
- "ARGB",
- "HSL",
- "RGB",
- "Color",
- "Colormix1",
- "Colormix2",
- "SysColor",
- "ColorMapHue",
- "ColorMapJet",
- "black",
- "blue",
- "brown",
- "cyan",
- "darkgray",
- "green",
- "lightblue",
- "lightcyan",
- "lightgray",
- "lightgreen",
- "lightmagenta",
- "lightred",
- "magenta",
- "red",
- "white",
- "yellow",
- # Conditional functions
- "alt",
- "class",
- "coalesce",
- "if",
- "match",
- "mixmatch",
- "pick",
- "wildmatch",
- # Counter functions
- "autonumber",
- "autonumberhash128",
- "autonumberhash256",
- "IterNo",
- "RecNo",
- "RowNo",
- # Integer expressions of time
- "second",
- "minute",
- "hour",
- "day",
- "week",
- "month",
- "year",
- "weekyear",
- "weekday",
- # Timestamp functions
- "now",
- "today",
- "LocalTime",
- # Make functions
- "makedate",
- "makeweekdate",
- "maketime",
- # Other date functions
- "AddMonths",
- "AddYears",
- "yeartodate",
- # Timezone functions
- "timezone",
- "GMT",
- "UTC",
- "daylightsaving",
- "converttolocaltime",
- # Set time functions
- "setdateyear",
- "setdateyearmonth",
- # In... functions
- "inyear",
- "inyeartodate",
- "inquarter",
- "inquartertodate",
- "inmonth",
- "inmonthtodate",
- "inmonths",
- "inmonthstodate",
- "inweek",
- "inweektodate",
- "inlunarweek",
- "inlunarweektodate",
- "inday",
- "indaytotime",
- # Start ... end functions
- "yearstart",
- "yearend",
- "yearname",
- "quarterstart",
- "quarterend",
- "quartername",
- "monthstart",
- "monthend",
- "monthname",
- "monthsstart",
- "monthsend",
- "monthsname",
- "weekstart",
- "weekend",
- "weekname",
- "lunarweekstart",
- "lunarweekend",
- "lunarweekname",
- "daystart",
- "dayend",
- "dayname",
- # Day numbering functions
- "age",
- "networkdays",
- "firstworkdate",
- "lastworkdate",
- "daynumberofyear",
- "daynumberofquarter",
- # Exponential and logarithmic
- "exp",
- "log",
- "log10",
- "pow",
- "sqr",
- "sqrt",
- # Count functions
- "GetAlternativeCount",
- "GetExcludedCount",
- "GetNotSelectedCount",
- "GetPossibleCount",
- "GetSelectedCount",
- # Field and selection functions
- "GetCurrentSelections",
- "GetFieldSelections",
- "GetObjectDimension",
- "GetObjectField",
- "GetObjectMeasure",
- # File functions
- "Attribute",
- "ConnectString",
- "FileBaseName",
- "FileDir",
- "FileExtension",
- "FileName",
- "FilePath",
- "FileSize",
- "FileTime",
- "GetFolderPath",
- "QvdCreateTime",
- "QvdFieldName",
- "QvdNoOfFields",
- "QvdNoOfRecords",
- "QvdTableName",
- # Financial functions
- "FV",
- "nPer",
- "Pmt",
- "PV",
- "Rate",
- # Formatting functions
- "ApplyCodepage",
- "Date",
- "Dual",
- "Interval",
- "Money",
- "Num",
- "Time",
- "Timestamp",
- # General numeric functions
- "bitcount",
- "div",
- "fabs",
- "fact",
- "frac",
- "sign",
- # Combination and permutation functions
- "combin",
- "permut",
- # Modulo functions
- "fmod",
- "mod",
- # Parity functions
- "even",
- "odd",
- # Rounding functions
- "ceil",
- "floor",
- "round",
- # Geospatial functions
- "GeoAggrGeometry",
- "GeoBoundingBox",
- "GeoCountVertex",
- "GeoInvProjectGeometry",
- "GeoProjectGeometry",
- "GeoReduceGeometry",
- "GeoGetBoundingBox",
- "GeoGetPolygonCenter",
- "GeoMakePoint",
- "GeoProject",
- # Interpretation functions
- "Date#",
- "Interval#",
- "Money#",
- "Num#",
- "Text",
- "Time#",
- "Timestamp#",
- # Field functions
- "FieldIndex",
- "FieldValue",
- "FieldValueCount",
- # Inter-record functions in the data load script
- "Exists",
- "LookUp",
- "Peek",
- "Previous",
- # Logical functions
- "IsNum",
- "IsText",
- # Mapping functions
- "ApplyMap",
- "MapSubstring",
- # Mathematical functions
- "e",
- "false",
- "pi",
- "rand",
- "true",
- # NULL functions
- "EmptyIsNull",
- "IsNull",
- "Null",
- # Basic range functions
- "RangeMax",
- "RangeMaxString",
- "RangeMin",
- "RangeMinString",
- "RangeMode",
- "RangeOnly",
- "RangeSum",
- # Counter range functions
- "RangeCount",
- "RangeMissingCount",
- "RangeNullCount",
- "RangeNumericCount",
- "RangeTextCount",
- # Statistical range functions
- "RangeAvg",
- "RangeCorrel",
- "RangeFractile",
- "RangeKurtosis",
- "RangeSkew",
- "RangeStdev",
- # Financial range functions
- "RangeIRR",
- "RangeNPV",
- "RangeXIRR",
- "RangeXNPV",
- # Statistical distribution
- "CHIDIST",
- "CHIINV",
- "NORMDIST",
- "NORMINV",
- "TDIST",
- "TINV",
- "FDIST",
- "FINV",
- # String functions
- "Capitalize",
- "Chr",
- "Evaluate",
- "FindOneOf",
- "Hash128",
- "Hash160",
- "Hash256",
- "Index",
- "KeepChar",
- "Left",
- "Len",
- "LevenshteinDist",
- "Lower",
- "LTrim",
- "Mid",
- "Ord",
- "PurgeChar",
- "Repeat",
- "Replace",
- "Right",
- "RTrim",
- "SubField",
- "SubStringCount",
- "TextBetween",
- "Trim",
- "Upper",
- # System functions
- "Author",
- "ClientPlatform",
- "ComputerName",
- "DocumentName",
- "DocumentPath",
- "DocumentTitle",
- "EngineVersion",
- "GetCollationLocale",
- "GetObjectField",
- "GetRegistryString",
- "IsPartialReload",
- "OSUser",
- "ProductVersion",
- "ReloadTime",
- "StateName",
- # Table functions
- "FieldName",
- "FieldNumber",
- "NoOfFields",
- "NoOfRows",
- "NoOfTables",
- "TableName",
- "TableNumber",
- ]
- # System variables and constants
- # see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/work-with-variables-in-data-load-editor.htm
- CONSTANT_LIST = [
- # System Variables
- "floppy",
- "cd",
- "include",
- "must_include",
- "hideprefix",
- "hidesuffix",
- "qvpath",
- "qvroot",
- "QvWorkPath",
- "QvWorkRoot",
- "StripComments",
- "Verbatim",
- "OpenUrlTimeout",
- "WinPath",
- "WinRoot",
- "CollationLocale",
- "CreateSearchIndexOnReload",
- # value handling variables
- "NullDisplay",
- "NullInterpret",
- "NullValue",
- "OtherSymbol",
- # Currency formatting
- "MoneyDecimalSep",
- "MoneyFormat",
- "MoneyThousandSep",
- # Number formatting
- "DecimalSep",
- "ThousandSep",
- "NumericalAbbreviation",
- # Time formatting
- "DateFormat",
- "TimeFormat",
- "TimestampFormat",
- "MonthNames",
- "LongMonthNames",
- "DayNames",
- "LongDayNames",
- "FirstWeekDay",
- "BrokenWeeks",
- "ReferenceDay",
- "FirstMonthOfYear",
- # Error variables
- "errormode",
- "scripterror",
- "scripterrorcount",
- "scripterrorlist",
- # Other
- "null",
- ]
|