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

8 statements  

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

1""" 

2 pygments.lexers._tsql_builtins 

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

4 

5 These are manually translated lists from https://msdn.microsoft.com. 

6 

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

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11# See https://msdn.microsoft.com/en-us/library/ms174986.aspx. 

12OPERATORS = ( 

13 '!<', 

14 '!=', 

15 '!>', 

16 '<', 

17 '<=', 

18 '<>', 

19 '=', 

20 '>', 

21 '>=', 

22 '+', 

23 '+=', 

24 '-', 

25 '-=', 

26 '*', 

27 '*=', 

28 '/', 

29 '/=', 

30 '%', 

31 '%=', 

32 '&', 

33 '&=', 

34 '|', 

35 '|=', 

36 '^', 

37 '^=', 

38 '~', 

39 '::', 

40) 

41 

42OPERATOR_WORDS = ( 

43 'all', 

44 'and', 

45 'any', 

46 'between', 

47 'except', 

48 'exists', 

49 'in', 

50 'intersect', 

51 'like', 

52 'not', 

53 'or', 

54 'some', 

55 'union', 

56) 

57 

58_KEYWORDS_SERVER = ( 

59 'add', 

60 'all', 

61 'alter', 

62 'and', 

63 'any', 

64 'as', 

65 'asc', 

66 'authorization', 

67 'backup', 

68 'begin', 

69 'between', 

70 'break', 

71 'browse', 

72 'bulk', 

73 'by', 

74 'cascade', 

75 'case', 

76 'catch', 

77 'check', 

78 'checkpoint', 

79 'close', 

80 'clustered', 

81 'coalesce', 

82 'collate', 

83 'column', 

84 'commit', 

85 'compute', 

86 'constraint', 

87 'contains', 

88 'containstable', 

89 'continue', 

90 'convert', 

91 'create', 

92 'cross', 

93 'current', 

94 'current_date', 

95 'current_time', 

96 'current_timestamp', 

97 'current_user', 

98 'cursor', 

99 'database', 

100 'dbcc', 

101 'deallocate', 

102 'declare', 

103 'default', 

104 'delete', 

105 'deny', 

106 'desc', 

107 'disk', 

108 'distinct', 

109 'distributed', 

110 'double', 

111 'drop', 

112 'dump', 

113 'else', 

114 'end', 

115 'errlvl', 

116 'escape', 

117 'except', 

118 'exec', 

119 'execute', 

120 'exists', 

121 'exit', 

122 'external', 

123 'fetch', 

124 'file', 

125 'fillfactor', 

126 'for', 

127 'foreign', 

128 'freetext', 

129 'freetexttable', 

130 'from', 

131 'full', 

132 'function', 

133 'goto', 

134 'grant', 

135 'group', 

136 'having', 

137 'holdlock', 

138 'identity', 

139 'identity_insert', 

140 'identitycol', 

141 'if', 

142 'in', 

143 'index', 

144 'inner', 

145 'insert', 

146 'intersect', 

147 'into', 

148 'is', 

149 'join', 

150 'key', 

151 'kill', 

152 'left', 

153 'like', 

154 'lineno', 

155 'load', 

156 'merge', 

157 'national', 

158 'nocheck', 

159 'nonclustered', 

160 'not', 

161 'null', 

162 'nullif', 

163 'of', 

164 'off', 

165 'offsets', 

166 'on', 

167 'open', 

168 'opendatasource', 

169 'openquery', 

170 'openrowset', 

171 'openxml', 

172 'option', 

173 'or', 

174 'order', 

175 'outer', 

176 'over', 

177 'percent', 

178 'pivot', 

179 'plan', 

180 'precision', 

181 'primary', 

182 'print', 

183 'proc', 

184 'procedure', 

185 'public', 

186 'raiserror', 

187 'read', 

188 'readtext', 

189 'reconfigure', 

190 'references', 

191 'replication', 

192 'restore', 

193 'restrict', 

194 'return', 

195 'revert', 

196 'revoke', 

197 'right', 

198 'rollback', 

199 'rowcount', 

200 'rowguidcol', 

201 'rule', 

202 'save', 

203 'schema', 

204 'securityaudit', 

205 'select', 

206 'semantickeyphrasetable', 

207 'semanticsimilaritydetailstable', 

208 'semanticsimilaritytable', 

209 'session_user', 

210 'set', 

211 'setuser', 

212 'shutdown', 

213 'some', 

214 'statistics', 

215 'system_user', 

216 'table', 

217 'tablesample', 

218 'textsize', 

219 'then', 

220 'throw', 

221 'to', 

222 'top', 

223 'tran', 

224 'transaction', 

225 'trigger', 

226 'truncate', 

227 'try', 

228 'try_convert', 

229 'tsequal', 

230 'union', 

231 'unique', 

232 'unpivot', 

233 'update', 

234 'updatetext', 

235 'use', 

236 'user', 

237 'values', 

238 'varying', 

239 'view', 

240 'waitfor', 

241 'when', 

242 'where', 

243 'while', 

244 'with', 

245 'within', 

246 'writetext', 

247) 

248 

249_KEYWORDS_FUTURE = ( 

250 'absolute', 

251 'action', 

252 'admin', 

253 'after', 

254 'aggregate', 

255 'alias', 

256 'allocate', 

257 'are', 

258 'array', 

259 'asensitive', 

260 'assertion', 

261 'asymmetric', 

262 'at', 

263 'atomic', 

264 'before', 

265 'binary', 

266 'bit', 

267 'blob', 

268 'boolean', 

269 'both', 

270 'breadth', 

271 'call', 

272 'called', 

273 'cardinality', 

274 'cascaded', 

275 'cast', 

276 'catalog', 

277 'char', 

278 'character', 

279 'class', 

280 'clob', 

281 'collation', 

282 'collect', 

283 'completion', 

284 'condition', 

285 'connect', 

286 'connection', 

287 'constraints', 

288 'constructor', 

289 'corr', 

290 'corresponding', 

291 'covar_pop', 

292 'covar_samp', 

293 'cube', 

294 'cume_dist', 

295 'current_catalog', 

296 'current_default_transform_group', 

297 'current_path', 

298 'current_role', 

299 'current_schema', 

300 'current_transform_group_for_type', 

301 'cycle', 

302 'data', 

303 'date', 

304 'day', 

305 'dec', 

306 'decimal', 

307 'deferrable', 

308 'deferred', 

309 'depth', 

310 'deref', 

311 'describe', 

312 'descriptor', 

313 'destroy', 

314 'destructor', 

315 'deterministic', 

316 'diagnostics', 

317 'dictionary', 

318 'disconnect', 

319 'domain', 

320 'dynamic', 

321 'each', 

322 'element', 

323 'end-exec', 

324 'equals', 

325 'every', 

326 'exception', 

327 'false', 

328 'filter', 

329 'first', 

330 'float', 

331 'found', 

332 'free', 

333 'fulltexttable', 

334 'fusion', 

335 'general', 

336 'get', 

337 'global', 

338 'go', 

339 'grouping', 

340 'hold', 

341 'host', 

342 'hour', 

343 'ignore', 

344 'immediate', 

345 'indicator', 

346 'initialize', 

347 'initially', 

348 'inout', 

349 'input', 

350 'int', 

351 'integer', 

352 'intersection', 

353 'interval', 

354 'isolation', 

355 'iterate', 

356 'language', 

357 'large', 

358 'last', 

359 'lateral', 

360 'leading', 

361 'less', 

362 'level', 

363 'like_regex', 

364 'limit', 

365 'ln', 

366 'local', 

367 'localtime', 

368 'localtimestamp', 

369 'locator', 

370 'map', 

371 'match', 

372 'member', 

373 'method', 

374 'minute', 

375 'mod', 

376 'modifies', 

377 'modify', 

378 'module', 

379 'month', 

380 'multiset', 

381 'names', 

382 'natural', 

383 'nchar', 

384 'nclob', 

385 'new', 

386 'next', 

387 'no', 

388 'none', 

389 'normalize', 

390 'numeric', 

391 'object', 

392 'occurrences_regex', 

393 'old', 

394 'only', 

395 'operation', 

396 'ordinality', 

397 'out', 

398 'output', 

399 'overlay', 

400 'pad', 

401 'parameter', 

402 'parameters', 

403 'partial', 

404 'partition', 

405 'path', 

406 'percent_rank', 

407 'percentile_cont', 

408 'percentile_disc', 

409 'position_regex', 

410 'postfix', 

411 'prefix', 

412 'preorder', 

413 'prepare', 

414 'preserve', 

415 'prior', 

416 'privileges', 

417 'range', 

418 'reads', 

419 'real', 

420 'recursive', 

421 'ref', 

422 'referencing', 

423 'regr_avgx', 

424 'regr_avgy', 

425 'regr_count', 

426 'regr_intercept', 

427 'regr_r2', 

428 'regr_slope', 

429 'regr_sxx', 

430 'regr_sxy', 

431 'regr_syy', 

432 'relative', 

433 'release', 

434 'result', 

435 'returns', 

436 'role', 

437 'rollup', 

438 'routine', 

439 'row', 

440 'rows', 

441 'savepoint', 

442 'scope', 

443 'scroll', 

444 'search', 

445 'second', 

446 'section', 

447 'sensitive', 

448 'sequence', 

449 'session', 

450 'sets', 

451 'similar', 

452 'size', 

453 'smallint', 

454 'space', 

455 'specific', 

456 'specifictype', 

457 'sql', 

458 'sqlexception', 

459 'sqlstate', 

460 'sqlwarning', 

461 'start', 

462 'state', 

463 'statement', 

464 'static', 

465 'stddev_pop', 

466 'stddev_samp', 

467 'structure', 

468 'submultiset', 

469 'substring_regex', 

470 'symmetric', 

471 'system', 

472 'temporary', 

473 'terminate', 

474 'than', 

475 'time', 

476 'timestamp', 

477 'timezone_hour', 

478 'timezone_minute', 

479 'trailing', 

480 'translate_regex', 

481 'translation', 

482 'treat', 

483 'true', 

484 'uescape', 

485 'under', 

486 'unknown', 

487 'unnest', 

488 'usage', 

489 'using', 

490 'value', 

491 'var_pop', 

492 'var_samp', 

493 'varchar', 

494 'variable', 

495 'whenever', 

496 'width_bucket', 

497 'window', 

498 'within', 

499 'without', 

500 'work', 

501 'write', 

502 'xmlagg', 

503 'xmlattributes', 

504 'xmlbinary', 

505 'xmlcast', 

506 'xmlcomment', 

507 'xmlconcat', 

508 'xmldocument', 

509 'xmlelement', 

510 'xmlexists', 

511 'xmlforest', 

512 'xmliterate', 

513 'xmlnamespaces', 

514 'xmlparse', 

515 'xmlpi', 

516 'xmlquery', 

517 'xmlserialize', 

518 'xmltable', 

519 'xmltext', 

520 'xmlvalidate', 

521 'year', 

522 'zone', 

523) 

524 

525_KEYWORDS_ODBC = ( 

526 'absolute', 

527 'action', 

528 'ada', 

529 'add', 

530 'all', 

531 'allocate', 

532 'alter', 

533 'and', 

534 'any', 

535 'are', 

536 'as', 

537 'asc', 

538 'assertion', 

539 'at', 

540 'authorization', 

541 'avg', 

542 'begin', 

543 'between', 

544 'bit', 

545 'bit_length', 

546 'both', 

547 'by', 

548 'cascade', 

549 'cascaded', 

550 'case', 

551 'cast', 

552 'catalog', 

553 'char', 

554 'char_length', 

555 'character', 

556 'character_length', 

557 'check', 

558 'close', 

559 'coalesce', 

560 'collate', 

561 'collation', 

562 'column', 

563 'commit', 

564 'connect', 

565 'connection', 

566 'constraint', 

567 'constraints', 

568 'continue', 

569 'convert', 

570 'corresponding', 

571 'count', 

572 'create', 

573 'cross', 

574 'current', 

575 'current_date', 

576 'current_time', 

577 'current_timestamp', 

578 'current_user', 

579 'cursor', 

580 'date', 

581 'day', 

582 'deallocate', 

583 'dec', 

584 'decimal', 

585 'declare', 

586 'default', 

587 'deferrable', 

588 'deferred', 

589 'delete', 

590 'desc', 

591 'describe', 

592 'descriptor', 

593 'diagnostics', 

594 'disconnect', 

595 'distinct', 

596 'domain', 

597 'double', 

598 'drop', 

599 'else', 

600 'end', 

601 'end-exec', 

602 'escape', 

603 'except', 

604 'exception', 

605 'exec', 

606 'execute', 

607 'exists', 

608 'external', 

609 'extract', 

610 'false', 

611 'fetch', 

612 'first', 

613 'float', 

614 'for', 

615 'foreign', 

616 'fortran', 

617 'found', 

618 'from', 

619 'full', 

620 'get', 

621 'global', 

622 'go', 

623 'goto', 

624 'grant', 

625 'group', 

626 'having', 

627 'hour', 

628 'identity', 

629 'immediate', 

630 'in', 

631 'include', 

632 'index', 

633 'indicator', 

634 'initially', 

635 'inner', 

636 'input', 

637 'insensitive', 

638 'insert', 

639 'int', 

640 'integer', 

641 'intersect', 

642 'interval', 

643 'into', 

644 'is', 

645 'isolation', 

646 'join', 

647 'key', 

648 'language', 

649 'last', 

650 'leading', 

651 'left', 

652 'level', 

653 'like', 

654 'local', 

655 'lower', 

656 'match', 

657 'max', 

658 'min', 

659 'minute', 

660 'module', 

661 'month', 

662 'names', 

663 'national', 

664 'natural', 

665 'nchar', 

666 'next', 

667 'no', 

668 'none', 

669 'not', 

670 'null', 

671 'nullif', 

672 'numeric', 

673 'octet_length', 

674 'of', 

675 'on', 

676 'only', 

677 'open', 

678 'option', 

679 'or', 

680 'order', 

681 'outer', 

682 'output', 

683 'overlaps', 

684 'pad', 

685 'partial', 

686 'pascal', 

687 'position', 

688 'precision', 

689 'prepare', 

690 'preserve', 

691 'primary', 

692 'prior', 

693 'privileges', 

694 'procedure', 

695 'public', 

696 'read', 

697 'real', 

698 'references', 

699 'relative', 

700 'restrict', 

701 'revoke', 

702 'right', 

703 'rollback', 

704 'rows', 

705 'schema', 

706 'scroll', 

707 'second', 

708 'section', 

709 'select', 

710 'session', 

711 'session_user', 

712 'set', 

713 'size', 

714 'smallint', 

715 'some', 

716 'space', 

717 'sql', 

718 'sqlca', 

719 'sqlcode', 

720 'sqlerror', 

721 'sqlstate', 

722 'sqlwarning', 

723 'substring', 

724 'sum', 

725 'system_user', 

726 'table', 

727 'temporary', 

728 'then', 

729 'time', 

730 'timestamp', 

731 'timezone_hour', 

732 'timezone_minute', 

733 'to', 

734 'trailing', 

735 'transaction', 

736 'translate', 

737 'translation', 

738 'trim', 

739 'true', 

740 'union', 

741 'unique', 

742 'unknown', 

743 'update', 

744 'upper', 

745 'usage', 

746 'user', 

747 'using', 

748 'value', 

749 'values', 

750 'varchar', 

751 'varying', 

752 'view', 

753 'when', 

754 'whenever', 

755 'where', 

756 'with', 

757 'work', 

758 'write', 

759 'year', 

760 'zone', 

761) 

762 

763# See https://msdn.microsoft.com/en-us/library/ms189822.aspx. 

764KEYWORDS = sorted(set(_KEYWORDS_FUTURE + _KEYWORDS_ODBC + _KEYWORDS_SERVER)) 

765 

766# See https://msdn.microsoft.com/en-us/library/ms187752.aspx. 

767TYPES = ( 

768 'bigint', 

769 'binary', 

770 'bit', 

771 'char', 

772 'cursor', 

773 'date', 

774 'datetime', 

775 'datetime2', 

776 'datetimeoffset', 

777 'decimal', 

778 'float', 

779 'hierarchyid', 

780 'image', 

781 'int', 

782 'money', 

783 'nchar', 

784 'ntext', 

785 'numeric', 

786 'nvarchar', 

787 'real', 

788 'smalldatetime', 

789 'smallint', 

790 'smallmoney', 

791 'sql_variant', 

792 'table', 

793 'text', 

794 'time', 

795 'timestamp', 

796 'tinyint', 

797 'uniqueidentifier', 

798 'varbinary', 

799 'varchar', 

800 'xml', 

801) 

802 

803# See https://msdn.microsoft.com/en-us/library/ms174318.aspx. 

804FUNCTIONS = ( 

805 '$partition', 

806 'abs', 

807 'acos', 

808 'app_name', 

809 'applock_mode', 

810 'applock_test', 

811 'ascii', 

812 'asin', 

813 'assemblyproperty', 

814 'atan', 

815 'atn2', 

816 'avg', 

817 'binary_checksum', 

818 'cast', 

819 'ceiling', 

820 'certencoded', 

821 'certprivatekey', 

822 'char', 

823 'charindex', 

824 'checksum', 

825 'checksum_agg', 

826 'choose', 

827 'col_length', 

828 'col_name', 

829 'columnproperty', 

830 'compress', 

831 'concat', 

832 'connectionproperty', 

833 'context_info', 

834 'convert', 

835 'cos', 

836 'cot', 

837 'count', 

838 'count_big', 

839 'current_request_id', 

840 'current_timestamp', 

841 'current_transaction_id', 

842 'current_user', 

843 'cursor_status', 

844 'database_principal_id', 

845 'databasepropertyex', 

846 'dateadd', 

847 'datediff', 

848 'datediff_big', 

849 'datefromparts', 

850 'datename', 

851 'datepart', 

852 'datetime2fromparts', 

853 'datetimefromparts', 

854 'datetimeoffsetfromparts', 

855 'day', 

856 'db_id', 

857 'db_name', 

858 'decompress', 

859 'degrees', 

860 'dense_rank', 

861 'difference', 

862 'eomonth', 

863 'error_line', 

864 'error_message', 

865 'error_number', 

866 'error_procedure', 

867 'error_severity', 

868 'error_state', 

869 'exp', 

870 'file_id', 

871 'file_idex', 

872 'file_name', 

873 'filegroup_id', 

874 'filegroup_name', 

875 'filegroupproperty', 

876 'fileproperty', 

877 'floor', 

878 'format', 

879 'formatmessage', 

880 'fulltextcatalogproperty', 

881 'fulltextserviceproperty', 

882 'get_filestream_transaction_context', 

883 'getansinull', 

884 'getdate', 

885 'getutcdate', 

886 'grouping', 

887 'grouping_id', 

888 'has_perms_by_name', 

889 'host_id', 

890 'host_name', 

891 'iif', 

892 'index_col', 

893 'indexkey_property', 

894 'indexproperty', 

895 'is_member', 

896 'is_rolemember', 

897 'is_srvrolemember', 

898 'isdate', 

899 'isjson', 

900 'isnull', 

901 'isnumeric', 

902 'json_modify', 

903 'json_query', 

904 'json_value', 

905 'left', 

906 'len', 

907 'log', 

908 'log10', 

909 'lower', 

910 'ltrim', 

911 'max', 

912 'min', 

913 'min_active_rowversion', 

914 'month', 

915 'nchar', 

916 'newid', 

917 'newsequentialid', 

918 'ntile', 

919 'object_definition', 

920 'object_id', 

921 'object_name', 

922 'object_schema_name', 

923 'objectproperty', 

924 'objectpropertyex', 

925 'opendatasource', 

926 'openjson', 

927 'openquery', 

928 'openrowset', 

929 'openxml', 

930 'original_db_name', 

931 'original_login', 

932 'parse', 

933 'parsename', 

934 'patindex', 

935 'permissions', 

936 'pi', 

937 'power', 

938 'pwdcompare', 

939 'pwdencrypt', 

940 'quotename', 

941 'radians', 

942 'rand', 

943 'rank', 

944 'replace', 

945 'replicate', 

946 'reverse', 

947 'right', 

948 'round', 

949 'row_number', 

950 'rowcount_big', 

951 'rtrim', 

952 'schema_id', 

953 'schema_name', 

954 'scope_identity', 

955 'serverproperty', 

956 'session_context', 

957 'session_user', 

958 'sign', 

959 'sin', 

960 'smalldatetimefromparts', 

961 'soundex', 

962 'sp_helplanguage', 

963 'space', 

964 'sqrt', 

965 'square', 

966 'stats_date', 

967 'stdev', 

968 'stdevp', 

969 'str', 

970 'string_escape', 

971 'string_split', 

972 'stuff', 

973 'substring', 

974 'sum', 

975 'suser_id', 

976 'suser_name', 

977 'suser_sid', 

978 'suser_sname', 

979 'switchoffset', 

980 'sysdatetime', 

981 'sysdatetimeoffset', 

982 'system_user', 

983 'sysutcdatetime', 

984 'tan', 

985 'textptr', 

986 'textvalid', 

987 'timefromparts', 

988 'todatetimeoffset', 

989 'try_cast', 

990 'try_convert', 

991 'try_parse', 

992 'type_id', 

993 'type_name', 

994 'typeproperty', 

995 'unicode', 

996 'upper', 

997 'user_id', 

998 'user_name', 

999 'var', 

1000 'varp', 

1001 'xact_state', 

1002 'year', 

1003)