Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pygments/lexers/_qlik_builtins.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1""" 

2 pygments.lexers._qlik_builtins 

3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

4 

5 Qlik builtins. 

6 

7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. 

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11# operators 

12# see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/Operators/operators.htm 

13OPERATORS_LIST = { 

14 "words": [ 

15 # Bit operators 

16 "bitnot", 

17 "bitand", 

18 "bitor", 

19 "bitxor", 

20 # Logical operators 

21 "and", 

22 "or", 

23 "not", 

24 "xor", 

25 # Relational operators 

26 "precedes", 

27 "follows", 

28 # String operators 

29 "like", 

30 ], 

31 "symbols": [ 

32 # Bit operators 

33 ">>", 

34 "<<", 

35 # Logical operators 

36 # Numeric operators 

37 "+", 

38 "-", 

39 "/", 

40 "*", 

41 # Relational operators 

42 "<", 

43 "<=", 

44 ">", 

45 ">=", 

46 "=", 

47 "<>", 

48 # String operators 

49 "&", 

50 ], 

51} 

52 

53# SCRIPT STATEMENTS 

54# see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ 

55STATEMENT_LIST = [ 

56 # control statements 

57 "for", 

58 "each", 

59 "in", 

60 "next", 

61 "do", 

62 "while", 

63 "until", 

64 "unless", 

65 "loop", 

66 "return", 

67 "switch", 

68 "case", 

69 "default", 

70 "if", 

71 "else", 

72 "endif", 

73 "then", 

74 "end", 

75 "exit", 

76 "script", 

77 "switch", 

78 # prefixes 

79 "Add", 

80 "Buffer", 

81 "Concatenate", 

82 "Crosstable", 

83 "First", 

84 "Generic", 

85 "Hierarchy", 

86 "HierarchyBelongsTo", 

87 "Inner", 

88 "IntervalMatch", 

89 "Join", 

90 "Keep", 

91 "Left", 

92 "Mapping", 

93 "Merge", 

94 "NoConcatenate", 

95 "Outer", 

96 "Partial reload", 

97 "Replace", 

98 "Right", 

99 "Sample", 

100 "Semantic", 

101 "Unless", 

102 "When", 

103 # regular statements 

104 "Alias", # alias ... as ... 

105 "as", 

106 "AutoNumber", 

107 "Binary", 

108 "Comment field", # comment fields ... using ... 

109 "Comment fields", # comment field ... with ... 

110 "using", 

111 "with", 

112 "Comment table", # comment table ... with ... 

113 "Comment tables", # comment tables ... using ... 

114 "Connect", 

115 "ODBC", # ODBC CONNECT TO ... 

116 "OLEBD", # OLEDB CONNECT TO ... 

117 "CUSTOM", # CUSTOM CONNECT TO ... 

118 "LIB", # LIB CONNECT TO ... 

119 "Declare", 

120 "Derive", 

121 "From", 

122 "explicit", 

123 "implicit", 

124 "Direct Query", 

125 "dimension", 

126 "measure", 

127 "Directory", 

128 "Disconnect", 

129 "Drop field", 

130 "Drop fields", 

131 "Drop table", 

132 "Drop tables", 

133 "Execute", 

134 "FlushLog", 

135 "Force", 

136 "capitalization", 

137 "case upper", 

138 "case lower", 

139 "case mixed", 

140 "Load", 

141 "distinct", 

142 "from", 

143 "inline", 

144 "resident", 

145 "from_field", 

146 "autogenerate", 

147 "extension", 

148 "where", 

149 "group by", 

150 "order by", 

151 "asc", 

152 "desc", 

153 "Let", 

154 "Loosen Table", 

155 "Map", 

156 "NullAsNull", 

157 "NullAsValue", 

158 "Qualify", 

159 "Rem", 

160 "Rename field", 

161 "Rename fields", 

162 "Rename table", 

163 "Rename tables", 

164 "Search", 

165 "include", 

166 "exclude", 

167 "Section", 

168 "access", 

169 "application", 

170 "Select", 

171 "Set", 

172 "Sleep", 

173 "SQL", 

174 "SQLColumns", 

175 "SQLTables", 

176 "SQLTypes", 

177 "Star", 

178 "Store", 

179 "Tag", 

180 "Trace", 

181 "Unmap", 

182 "Unqualify", 

183 "Untag", 

184 # Qualifiers 

185 "total", 

186] 

187 

188# Script functions 

189# see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-scripts-chart-expressions.htm 

190SCRIPT_FUNCTIONS = [ 

191 # Basic aggregation functions in the data load script 

192 "FirstSortedValue", 

193 "Max", 

194 "Min", 

195 "Mode", 

196 "Only", 

197 "Sum", 

198 # Counter aggregation functions in the data load script 

199 "Count", 

200 "MissingCount", 

201 "NullCount", 

202 "NumericCount", 

203 "TextCount", 

204 # Financial aggregation functions in the data load script 

205 "IRR", 

206 "XIRR", 

207 "NPV", 

208 "XNPV", 

209 # Statistical aggregation functions in the data load script 

210 "Avg", 

211 "Correl", 

212 "Fractile", 

213 "FractileExc", 

214 "Kurtosis", 

215 "LINEST_B" "LINEST_df", 

216 "LINEST_f", 

217 "LINEST_m", 

218 "LINEST_r2", 

219 "LINEST_seb", 

220 "LINEST_sem", 

221 "LINEST_sey", 

222 "LINEST_ssreg", 

223 "Linest_ssresid", 

224 "Median", 

225 "Skew", 

226 "Stdev", 

227 "Sterr", 

228 "STEYX", 

229 # Statistical test functions 

230 "Chi2Test_chi2", 

231 "Chi2Test_df", 

232 "Chi2Test_p", 

233 # Two independent samples t-tests 

234 "ttest_conf", 

235 "ttest_df", 

236 "ttest_dif", 

237 "ttest_lower", 

238 "ttest_sig", 

239 "ttest_sterr", 

240 "ttest_t", 

241 "ttest_upper", 

242 # Two independent weighted samples t-tests 

243 "ttestw_conf", 

244 "ttestw_df", 

245 "ttestw_dif", 

246 "ttestw_lower", 

247 "ttestw_sig", 

248 "ttestw_sterr", 

249 "ttestw_t", 

250 "ttestw_upper", 

251 # One sample t-tests 

252 "ttest1_conf", 

253 "ttest1_df", 

254 "ttest1_dif", 

255 "ttest1_lower", 

256 "ttest1_sig", 

257 "ttest1_sterr", 

258 "ttest1_t", 

259 "ttest1_upper", 

260 # One weighted sample t-tests 

261 "ttest1w_conf", 

262 "ttest1w_df", 

263 "ttest1w_dif", 

264 "ttest1w_lower", 

265 "ttest1w_sig", 

266 "ttest1w_sterr", 

267 "ttest1w_t", 

268 "ttest1w_upper", 

269 # One column format functions 

270 "ztest_conf", 

271 "ztest_dif", 

272 "ztest_sig", 

273 "ztest_sterr", 

274 "ztest_z", 

275 "ztest_lower", 

276 "ztest_upper", 

277 # Weighted two-column format functions 

278 "ztestw_conf", 

279 "ztestw_dif", 

280 "ztestw_lower", 

281 "ztestw_sig", 

282 "ztestw_sterr", 

283 "ztestw_upper", 

284 "ztestw_z", 

285 # String aggregation functions in the data load script 

286 "Concat", 

287 "FirstValue", 

288 "LastValue", 

289 "MaxString", 

290 "MinString", 

291 # Synthetic dimension functions 

292 "ValueList", 

293 "ValueLoop", 

294 # Color functions 

295 "ARGB", 

296 "HSL", 

297 "RGB", 

298 "Color", 

299 "Colormix1", 

300 "Colormix2", 

301 "SysColor", 

302 "ColorMapHue", 

303 "ColorMapJet", 

304 "black", 

305 "blue", 

306 "brown", 

307 "cyan", 

308 "darkgray", 

309 "green", 

310 "lightblue", 

311 "lightcyan", 

312 "lightgray", 

313 "lightgreen", 

314 "lightmagenta", 

315 "lightred", 

316 "magenta", 

317 "red", 

318 "white", 

319 "yellow", 

320 # Conditional functions 

321 "alt", 

322 "class", 

323 "coalesce", 

324 "if", 

325 "match", 

326 "mixmatch", 

327 "pick", 

328 "wildmatch", 

329 # Counter functions 

330 "autonumber", 

331 "autonumberhash128", 

332 "autonumberhash256", 

333 "IterNo", 

334 "RecNo", 

335 "RowNo", 

336 # Integer expressions of time 

337 "second", 

338 "minute", 

339 "hour", 

340 "day", 

341 "week", 

342 "month", 

343 "year", 

344 "weekyear", 

345 "weekday", 

346 # Timestamp functions 

347 "now", 

348 "today", 

349 "LocalTime", 

350 # Make functions 

351 "makedate", 

352 "makeweekdate", 

353 "maketime", 

354 # Other date functions 

355 "AddMonths", 

356 "AddYears", 

357 "yeartodate", 

358 # Timezone functions 

359 "timezone", 

360 "GMT", 

361 "UTC", 

362 "daylightsaving", 

363 "converttolocaltime", 

364 # Set time functions 

365 "setdateyear", 

366 "setdateyearmonth", 

367 # In... functions 

368 "inyear", 

369 "inyeartodate", 

370 "inquarter", 

371 "inquartertodate", 

372 "inmonth", 

373 "inmonthtodate", 

374 "inmonths", 

375 "inmonthstodate", 

376 "inweek", 

377 "inweektodate", 

378 "inlunarweek", 

379 "inlunarweektodate", 

380 "inday", 

381 "indaytotime", 

382 # Start ... end functions 

383 "yearstart", 

384 "yearend", 

385 "yearname", 

386 "quarterstart", 

387 "quarterend", 

388 "quartername", 

389 "monthstart", 

390 "monthend", 

391 "monthname", 

392 "monthsstart", 

393 "monthsend", 

394 "monthsname", 

395 "weekstart", 

396 "weekend", 

397 "weekname", 

398 "lunarweekstart", 

399 "lunarweekend", 

400 "lunarweekname", 

401 "daystart", 

402 "dayend", 

403 "dayname", 

404 # Day numbering functions 

405 "age", 

406 "networkdays", 

407 "firstworkdate", 

408 "lastworkdate", 

409 "daynumberofyear", 

410 "daynumberofquarter", 

411 # Exponential and logarithmic 

412 "exp", 

413 "log", 

414 "log10", 

415 "pow", 

416 "sqr", 

417 "sqrt", 

418 # Count functions 

419 "GetAlternativeCount", 

420 "GetExcludedCount", 

421 "GetNotSelectedCount", 

422 "GetPossibleCount", 

423 "GetSelectedCount", 

424 # Field and selection functions 

425 "GetCurrentSelections", 

426 "GetFieldSelections", 

427 "GetObjectDimension", 

428 "GetObjectField", 

429 "GetObjectMeasure", 

430 # File functions 

431 "Attribute", 

432 "ConnectString", 

433 "FileBaseName", 

434 "FileDir", 

435 "FileExtension", 

436 "FileName", 

437 "FilePath", 

438 "FileSize", 

439 "FileTime", 

440 "GetFolderPath", 

441 "QvdCreateTime", 

442 "QvdFieldName", 

443 "QvdNoOfFields", 

444 "QvdNoOfRecords", 

445 "QvdTableName", 

446 # Financial functions 

447 "FV", 

448 "nPer", 

449 "Pmt", 

450 "PV", 

451 "Rate", 

452 # Formatting functions 

453 "ApplyCodepage", 

454 "Date", 

455 "Dual", 

456 "Interval", 

457 "Money", 

458 "Num", 

459 "Time", 

460 "Timestamp", 

461 # General numeric functions 

462 "bitcount", 

463 "div", 

464 "fabs", 

465 "fact", 

466 "frac", 

467 "sign", 

468 # Combination and permutation functions 

469 "combin", 

470 "permut", 

471 # Modulo functions 

472 "fmod", 

473 "mod", 

474 # Parity functions 

475 "even", 

476 "odd", 

477 # Rounding functions 

478 "ceil", 

479 "floor", 

480 "round", 

481 # Geospatial functions 

482 "GeoAggrGeometry", 

483 "GeoBoundingBox", 

484 "GeoCountVertex", 

485 "GeoInvProjectGeometry", 

486 "GeoProjectGeometry", 

487 "GeoReduceGeometry", 

488 "GeoGetBoundingBox", 

489 "GeoGetPolygonCenter", 

490 "GeoMakePoint", 

491 "GeoProject", 

492 # Interpretation functions 

493 "Date#", 

494 "Interval#", 

495 "Money#", 

496 "Num#", 

497 "Text", 

498 "Time#", 

499 "Timestamp#", 

500 # Field functions 

501 "FieldIndex", 

502 "FieldValue", 

503 "FieldValueCount", 

504 # Inter-record functions in the data load script 

505 "Exists", 

506 "LookUp", 

507 "Peek", 

508 "Previous", 

509 # Logical functions 

510 "IsNum", 

511 "IsText", 

512 # Mapping functions 

513 "ApplyMap", 

514 "MapSubstring", 

515 # Mathematical functions 

516 "e", 

517 "false", 

518 "pi", 

519 "rand", 

520 "true", 

521 # NULL functions 

522 "EmptyIsNull", 

523 "IsNull", 

524 "Null", 

525 # Basic range functions 

526 "RangeMax", 

527 "RangeMaxString", 

528 "RangeMin", 

529 "RangeMinString", 

530 "RangeMode", 

531 "RangeOnly", 

532 "RangeSum", 

533 # Counter range functions 

534 "RangeCount", 

535 "RangeMissingCount", 

536 "RangeNullCount", 

537 "RangeNumericCount", 

538 "RangeTextCount", 

539 # Statistical range functions 

540 "RangeAvg", 

541 "RangeCorrel", 

542 "RangeFractile", 

543 "RangeKurtosis", 

544 "RangeSkew", 

545 "RangeStdev", 

546 # Financial range functions 

547 "RangeIRR", 

548 "RangeNPV", 

549 "RangeXIRR", 

550 "RangeXNPV", 

551 # Statistical distribution 

552 "CHIDIST", 

553 "CHIINV", 

554 "NORMDIST", 

555 "NORMINV", 

556 "TDIST", 

557 "TINV", 

558 "FDIST", 

559 "FINV", 

560 # String functions 

561 "Capitalize", 

562 "Chr", 

563 "Evaluate", 

564 "FindOneOf", 

565 "Hash128", 

566 "Hash160", 

567 "Hash256", 

568 "Index", 

569 "KeepChar", 

570 "Left", 

571 "Len", 

572 "LevenshteinDist", 

573 "Lower", 

574 "LTrim", 

575 "Mid", 

576 "Ord", 

577 "PurgeChar", 

578 "Repeat", 

579 "Replace", 

580 "Right", 

581 "RTrim", 

582 "SubField", 

583 "SubStringCount", 

584 "TextBetween", 

585 "Trim", 

586 "Upper", 

587 # System functions 

588 "Author", 

589 "ClientPlatform", 

590 "ComputerName", 

591 "DocumentName", 

592 "DocumentPath", 

593 "DocumentTitle", 

594 "EngineVersion", 

595 "GetCollationLocale", 

596 "GetObjectField", 

597 "GetRegistryString", 

598 "IsPartialReload", 

599 "OSUser", 

600 "ProductVersion", 

601 "ReloadTime", 

602 "StateName", 

603 # Table functions 

604 "FieldName", 

605 "FieldNumber", 

606 "NoOfFields", 

607 "NoOfRows", 

608 "NoOfTables", 

609 "TableName", 

610 "TableNumber", 

611] 

612 

613# System variables and constants 

614# see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/work-with-variables-in-data-load-editor.htm 

615CONSTANT_LIST = [ 

616 # System Variables 

617 "floppy", 

618 "cd", 

619 "include", 

620 "must_include", 

621 "hideprefix", 

622 "hidesuffix", 

623 "qvpath", 

624 "qvroot", 

625 "QvWorkPath", 

626 "QvWorkRoot", 

627 "StripComments", 

628 "Verbatim", 

629 "OpenUrlTimeout", 

630 "WinPath", 

631 "WinRoot", 

632 "CollationLocale", 

633 "CreateSearchIndexOnReload", 

634 # value handling variables 

635 "NullDisplay", 

636 "NullInterpret", 

637 "NullValue", 

638 "OtherSymbol", 

639 # Currency formatting 

640 "MoneyDecimalSep", 

641 "MoneyFormat", 

642 "MoneyThousandSep", 

643 # Number formatting 

644 "DecimalSep", 

645 "ThousandSep", 

646 "NumericalAbbreviation", 

647 # Time formatting 

648 "DateFormat", 

649 "TimeFormat", 

650 "TimestampFormat", 

651 "MonthNames", 

652 "LongMonthNames", 

653 "DayNames", 

654 "LongDayNames", 

655 "FirstWeekDay", 

656 "BrokenWeeks", 

657 "ReferenceDay", 

658 "FirstMonthOfYear", 

659 # Error variables 

660 "errormode", 

661 "scripterror", 

662 "scripterrorcount", 

663 "scripterrorlist", 

664 # Other 

665 "null", 

666]