abap.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. /*---------------------------------------------------------------------------------------------
  6. * ABAP Language
  7. *
  8. * Based on SAP ABAP Application Server 7.55
  9. *
  10. * Definition:
  11. * https://github.com/microsoft/monaco-languages/blob/master/src/abap/abap.ts
  12. *
  13. * Reference:
  14. * https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm?file=abenabap_words.htm
  15. * https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm?file=abenabap_index.htm
  16. *
  17. * Playground:
  18. * https://microsoft.github.io/monaco-editor/monarch.html
  19. *
  20. * Themes:
  21. * https://github.com/Microsoft/vscode/blob/master/src/vs/editor/standalone/common/themes.ts
  22. *--------------------------------------------------------------------------------------------*/
  23. import type { languages } from '../fillers/monaco-editor-core';
  24. export const conf: languages.LanguageConfiguration = {
  25. comments: {
  26. lineComment: '*'
  27. },
  28. brackets: [
  29. ['[', ']'],
  30. ['(', ')']
  31. ]
  32. };
  33. export const language = <languages.IMonarchLanguage>{
  34. defaultToken: 'invalid',
  35. ignoreCase: true,
  36. tokenPostfix: '.abap',
  37. keywords: [
  38. 'abap-source',
  39. 'abbreviated',
  40. 'abstract',
  41. 'accept',
  42. 'accepting',
  43. 'according',
  44. 'activation',
  45. 'actual',
  46. 'add',
  47. 'add-corresponding',
  48. 'adjacent',
  49. 'after',
  50. 'alias',
  51. 'aliases',
  52. 'align',
  53. 'all',
  54. 'allocate',
  55. 'alpha',
  56. 'analysis',
  57. 'analyzer',
  58. 'and', // also an operator
  59. 'append',
  60. 'appendage',
  61. 'appending',
  62. 'application',
  63. 'archive',
  64. 'area',
  65. 'arithmetic',
  66. 'as',
  67. 'ascending',
  68. 'aspect',
  69. 'assert',
  70. 'assign',
  71. 'assigned',
  72. 'assigning',
  73. 'association',
  74. 'asynchronous',
  75. 'at',
  76. 'attributes',
  77. 'authority',
  78. 'authority-check',
  79. 'avg',
  80. 'back',
  81. 'background',
  82. 'backup',
  83. 'backward',
  84. 'badi',
  85. 'base',
  86. 'before',
  87. 'begin',
  88. 'between', // also an operator
  89. 'big',
  90. 'binary',
  91. 'bintohex',
  92. 'bit',
  93. 'black',
  94. 'blank',
  95. 'blanks',
  96. 'blob',
  97. 'block',
  98. 'blocks',
  99. 'blue',
  100. 'bound',
  101. 'boundaries',
  102. 'bounds',
  103. 'boxed',
  104. 'break-point',
  105. 'buffer',
  106. 'by',
  107. 'bypassing',
  108. 'byte',
  109. 'byte-order',
  110. 'call',
  111. 'calling',
  112. 'case',
  113. 'cast',
  114. 'casting',
  115. 'catch',
  116. 'center',
  117. 'centered',
  118. 'chain',
  119. 'chain-input',
  120. 'chain-request',
  121. 'change',
  122. 'changing',
  123. 'channels',
  124. 'character',
  125. 'char-to-hex',
  126. 'check',
  127. 'checkbox',
  128. 'ci_',
  129. 'circular',
  130. 'class',
  131. 'class-coding',
  132. 'class-data',
  133. 'class-events',
  134. 'class-methods',
  135. 'class-pool',
  136. 'cleanup',
  137. 'clear',
  138. 'client',
  139. 'clob',
  140. 'clock',
  141. 'close',
  142. 'coalesce',
  143. 'code',
  144. 'coding',
  145. 'col_background',
  146. 'col_group',
  147. 'col_heading',
  148. 'col_key',
  149. 'col_negative',
  150. 'col_normal',
  151. 'col_positive',
  152. 'col_total',
  153. 'collect',
  154. 'color',
  155. 'column',
  156. 'columns',
  157. 'comment',
  158. 'comments',
  159. 'commit',
  160. 'common',
  161. 'communication',
  162. 'comparing',
  163. 'component',
  164. 'components',
  165. 'compression',
  166. 'compute',
  167. 'concat',
  168. 'concat_with_space',
  169. 'concatenate',
  170. 'cond',
  171. 'condense', // also a built-in
  172. 'condition',
  173. 'connect',
  174. 'connection',
  175. 'constants',
  176. 'context',
  177. 'contexts',
  178. 'continue',
  179. 'control',
  180. 'controls',
  181. 'conv',
  182. 'conversion',
  183. 'convert',
  184. 'copies',
  185. 'copy',
  186. 'corresponding',
  187. 'country',
  188. 'cover',
  189. 'cpi',
  190. 'create',
  191. 'creating',
  192. 'critical',
  193. 'currency',
  194. 'currency_conversion',
  195. 'current',
  196. 'cursor',
  197. 'cursor-selection',
  198. 'customer',
  199. 'customer-function',
  200. 'dangerous',
  201. 'data',
  202. 'database',
  203. 'datainfo',
  204. 'dataset',
  205. 'date',
  206. 'dats_add_days',
  207. 'dats_add_months',
  208. 'dats_days_between',
  209. 'dats_is_valid',
  210. 'daylight',
  211. 'dd/mm/yy',
  212. 'dd/mm/yyyy',
  213. 'ddmmyy',
  214. 'deallocate',
  215. 'decimal_shift',
  216. 'decimals',
  217. 'declarations',
  218. 'deep',
  219. 'default',
  220. 'deferred',
  221. 'define',
  222. 'defining',
  223. 'definition',
  224. 'delete',
  225. 'deleting',
  226. 'demand',
  227. 'department',
  228. 'descending',
  229. 'describe',
  230. 'destination',
  231. 'detail',
  232. 'dialog',
  233. 'directory',
  234. 'disconnect',
  235. 'display',
  236. 'display-mode',
  237. 'distinct',
  238. 'divide',
  239. 'divide-corresponding',
  240. 'division',
  241. 'do',
  242. 'dummy',
  243. 'duplicate',
  244. 'duplicates',
  245. 'duration',
  246. 'during',
  247. 'dynamic',
  248. 'dynpro',
  249. 'edit',
  250. 'editor-call',
  251. 'else',
  252. 'elseif',
  253. 'empty',
  254. 'enabled',
  255. 'enabling',
  256. 'encoding',
  257. 'end',
  258. 'endat',
  259. 'endcase',
  260. 'endcatch',
  261. 'endchain',
  262. 'endclass',
  263. 'enddo',
  264. 'endenhancement',
  265. 'end-enhancement-section',
  266. 'endexec',
  267. 'endform',
  268. 'endfunction',
  269. 'endian',
  270. 'endif',
  271. 'ending',
  272. 'endinterface',
  273. 'end-lines',
  274. 'endloop',
  275. 'endmethod',
  276. 'endmodule',
  277. 'end-of-definition',
  278. 'end-of-editing',
  279. 'end-of-file',
  280. 'end-of-page',
  281. 'end-of-selection',
  282. 'endon',
  283. 'endprovide',
  284. 'endselect',
  285. 'end-test-injection',
  286. 'end-test-seam',
  287. 'endtry',
  288. 'endwhile',
  289. 'endwith',
  290. 'engineering',
  291. 'enhancement',
  292. 'enhancement-point',
  293. 'enhancements',
  294. 'enhancement-section',
  295. 'entries',
  296. 'entry',
  297. 'enum',
  298. 'environment',
  299. 'equiv', // also an operator
  300. 'errormessage',
  301. 'errors',
  302. 'escaping',
  303. 'event',
  304. 'events',
  305. 'exact',
  306. 'except',
  307. 'exception',
  308. 'exceptions',
  309. 'exception-table',
  310. 'exclude',
  311. 'excluding',
  312. 'exec',
  313. 'execute',
  314. 'exists',
  315. 'exit',
  316. 'exit-command',
  317. 'expand',
  318. 'expanding',
  319. 'expiration',
  320. 'explicit',
  321. 'exponent',
  322. 'export',
  323. 'exporting',
  324. 'extend',
  325. 'extended',
  326. 'extension',
  327. 'extract',
  328. 'fail',
  329. 'fetch',
  330. 'field',
  331. 'field-groups',
  332. 'fields',
  333. 'field-symbol',
  334. 'field-symbols',
  335. 'file',
  336. 'filter',
  337. 'filters',
  338. 'filter-table',
  339. 'final',
  340. 'find', // also a built-in
  341. 'first',
  342. 'first-line',
  343. 'fixed-point',
  344. 'fkeq',
  345. 'fkge',
  346. 'flush',
  347. 'font',
  348. 'for',
  349. 'form',
  350. 'format',
  351. 'forward',
  352. 'found',
  353. 'frame',
  354. 'frames',
  355. 'free',
  356. 'friends',
  357. 'from',
  358. 'function',
  359. 'functionality',
  360. 'function-pool',
  361. 'further',
  362. 'gaps',
  363. 'generate',
  364. 'get',
  365. 'giving',
  366. 'gkeq',
  367. 'gkge',
  368. 'global',
  369. 'grant',
  370. 'green',
  371. 'group',
  372. 'groups',
  373. 'handle',
  374. 'handler',
  375. 'harmless',
  376. 'hashed', // also a table type
  377. 'having',
  378. 'hdb',
  379. 'header',
  380. 'headers',
  381. 'heading',
  382. 'head-lines',
  383. 'help-id',
  384. 'help-request',
  385. 'hextobin',
  386. 'hide',
  387. 'high',
  388. 'hint',
  389. 'hold',
  390. 'hotspot',
  391. 'icon',
  392. 'id',
  393. 'identification',
  394. 'identifier',
  395. 'ids',
  396. 'if',
  397. 'ignore',
  398. 'ignoring',
  399. 'immediately',
  400. 'implementation',
  401. 'implementations',
  402. 'implemented',
  403. 'implicit',
  404. 'import',
  405. 'importing',
  406. 'in', // also an operator
  407. 'inactive',
  408. 'incl',
  409. 'include',
  410. 'includes',
  411. 'including',
  412. 'increment',
  413. 'index', // also a table type
  414. 'index-line',
  415. 'infotypes',
  416. 'inheriting',
  417. 'init',
  418. 'initial',
  419. 'initialization',
  420. 'inner',
  421. 'inout',
  422. 'input',
  423. 'insert', // also a built-in
  424. 'instance',
  425. 'instances',
  426. 'instr',
  427. 'intensified',
  428. 'interface',
  429. 'interface-pool',
  430. 'interfaces',
  431. 'internal',
  432. 'intervals',
  433. 'into',
  434. 'inverse',
  435. 'inverted-date',
  436. 'is',
  437. 'iso',
  438. 'job',
  439. 'join',
  440. 'keep',
  441. 'keeping',
  442. 'kernel',
  443. 'key',
  444. 'keys',
  445. 'keywords',
  446. 'kind',
  447. 'language',
  448. 'last',
  449. 'late',
  450. 'layout',
  451. 'leading',
  452. 'leave',
  453. 'left',
  454. 'left-justified',
  455. 'leftplus',
  456. 'leftspace',
  457. 'legacy',
  458. 'length',
  459. 'let',
  460. 'level',
  461. 'levels',
  462. 'like',
  463. 'line',
  464. 'lines', // also a built-in
  465. 'line-count',
  466. 'linefeed',
  467. 'line-selection',
  468. 'line-size',
  469. 'list',
  470. 'listbox',
  471. 'list-processing',
  472. 'little',
  473. 'llang',
  474. 'load',
  475. 'load-of-program',
  476. 'lob',
  477. 'local',
  478. 'locale',
  479. 'locator',
  480. 'logfile',
  481. 'logical',
  482. 'log-point',
  483. 'long',
  484. 'loop',
  485. 'low',
  486. 'lower',
  487. 'lpad',
  488. 'lpi',
  489. 'ltrim',
  490. 'mail',
  491. 'main',
  492. 'major-id',
  493. 'mapping',
  494. 'margin',
  495. 'mark',
  496. 'mask',
  497. 'match', // also a built-in
  498. 'matchcode',
  499. 'max',
  500. 'maximum',
  501. 'medium',
  502. 'members',
  503. 'memory',
  504. 'mesh',
  505. 'message',
  506. 'message-id',
  507. 'messages',
  508. 'messaging',
  509. 'method',
  510. 'methods',
  511. 'min',
  512. 'minimum',
  513. 'minor-id',
  514. 'mm/dd/yy',
  515. 'mm/dd/yyyy',
  516. 'mmddyy',
  517. 'mode',
  518. 'modif',
  519. 'modifier',
  520. 'modify',
  521. 'module',
  522. 'move',
  523. 'move-corresponding',
  524. 'multiply',
  525. 'multiply-corresponding',
  526. 'name',
  527. 'nametab',
  528. 'native',
  529. 'nested',
  530. 'nesting',
  531. 'new',
  532. 'new-line',
  533. 'new-page',
  534. 'new-section',
  535. 'next',
  536. 'no',
  537. 'no-display',
  538. 'no-extension',
  539. 'no-gap',
  540. 'no-gaps',
  541. 'no-grouping',
  542. 'no-heading',
  543. 'no-scrolling',
  544. 'no-sign',
  545. 'no-title',
  546. 'no-topofpage',
  547. 'no-zero',
  548. 'node',
  549. 'nodes',
  550. 'non-unicode',
  551. 'non-unique',
  552. 'not', // also an operator
  553. 'null',
  554. 'number',
  555. 'object', // also a data type
  556. 'objects',
  557. 'obligatory',
  558. 'occurrence',
  559. 'occurrences',
  560. 'occurs',
  561. 'of',
  562. 'off',
  563. 'offset',
  564. 'ole',
  565. 'on',
  566. 'only',
  567. 'open',
  568. 'option',
  569. 'optional',
  570. 'options',
  571. 'or', // also an operator
  572. 'order',
  573. 'other',
  574. 'others',
  575. 'out',
  576. 'outer',
  577. 'output',
  578. 'output-length',
  579. 'overflow',
  580. 'overlay',
  581. 'pack',
  582. 'package',
  583. 'pad',
  584. 'padding',
  585. 'page',
  586. 'pages',
  587. 'parameter',
  588. 'parameters',
  589. 'parameter-table',
  590. 'part',
  591. 'partially',
  592. 'pattern',
  593. 'percentage',
  594. 'perform',
  595. 'performing',
  596. 'person',
  597. 'pf1',
  598. 'pf10',
  599. 'pf11',
  600. 'pf12',
  601. 'pf13',
  602. 'pf14',
  603. 'pf15',
  604. 'pf2',
  605. 'pf3',
  606. 'pf4',
  607. 'pf5',
  608. 'pf6',
  609. 'pf7',
  610. 'pf8',
  611. 'pf9',
  612. 'pf-status',
  613. 'pink',
  614. 'places',
  615. 'pool',
  616. 'pos_high',
  617. 'pos_low',
  618. 'position',
  619. 'pragmas',
  620. 'precompiled',
  621. 'preferred',
  622. 'preserving',
  623. 'primary',
  624. 'print',
  625. 'print-control',
  626. 'priority',
  627. 'private',
  628. 'procedure',
  629. 'process',
  630. 'program',
  631. 'property',
  632. 'protected',
  633. 'provide',
  634. 'public',
  635. 'push',
  636. 'pushbutton',
  637. 'put',
  638. 'queue-only',
  639. 'quickinfo',
  640. 'radiobutton',
  641. 'raise',
  642. 'raising',
  643. 'range',
  644. 'ranges',
  645. 'read',
  646. 'reader',
  647. 'read-only',
  648. 'receive',
  649. 'received',
  650. 'receiver',
  651. 'receiving',
  652. 'red',
  653. 'redefinition',
  654. 'reduce',
  655. 'reduced',
  656. 'ref',
  657. 'reference',
  658. 'refresh',
  659. 'regex',
  660. 'reject',
  661. 'remote',
  662. 'renaming',
  663. 'replace', // also a built-in
  664. 'replacement',
  665. 'replacing',
  666. 'report',
  667. 'request',
  668. 'requested',
  669. 'reserve',
  670. 'reset',
  671. 'resolution',
  672. 'respecting',
  673. 'responsible',
  674. 'result',
  675. 'results',
  676. 'resumable',
  677. 'resume',
  678. 'retry',
  679. 'return',
  680. 'returncode',
  681. 'returning',
  682. 'returns',
  683. 'right',
  684. 'right-justified',
  685. 'rightplus',
  686. 'rightspace',
  687. 'risk',
  688. 'rmc_communication_failure',
  689. 'rmc_invalid_status',
  690. 'rmc_system_failure',
  691. 'role',
  692. 'rollback',
  693. 'rows',
  694. 'rpad',
  695. 'rtrim',
  696. 'run',
  697. 'sap',
  698. 'sap-spool',
  699. 'saving',
  700. 'scale_preserving',
  701. 'scale_preserving_scientific',
  702. 'scan',
  703. 'scientific',
  704. 'scientific_with_leading_zero',
  705. 'scroll',
  706. 'scroll-boundary',
  707. 'scrolling',
  708. 'search',
  709. 'secondary',
  710. 'seconds',
  711. 'section',
  712. 'select',
  713. 'selection',
  714. 'selections',
  715. 'selection-screen',
  716. 'selection-set',
  717. 'selection-sets',
  718. 'selection-table',
  719. 'select-options',
  720. 'send',
  721. 'separate',
  722. 'separated',
  723. 'set',
  724. 'shared',
  725. 'shift',
  726. 'short',
  727. 'shortdump-id',
  728. 'sign_as_postfix',
  729. 'single',
  730. 'size',
  731. 'skip',
  732. 'skipping',
  733. 'smart',
  734. 'some',
  735. 'sort',
  736. 'sortable',
  737. 'sorted', // also a table type
  738. 'source',
  739. 'specified',
  740. 'split',
  741. 'spool',
  742. 'spots',
  743. 'sql',
  744. 'sqlscript',
  745. 'stable',
  746. 'stamp',
  747. 'standard', // also a table type
  748. 'starting',
  749. 'start-of-editing',
  750. 'start-of-selection',
  751. 'state',
  752. 'statement',
  753. 'statements',
  754. 'static',
  755. 'statics',
  756. 'statusinfo',
  757. 'step-loop',
  758. 'stop',
  759. 'structure',
  760. 'structures',
  761. 'style',
  762. 'subkey',
  763. 'submatches',
  764. 'submit',
  765. 'subroutine',
  766. 'subscreen',
  767. 'subtract',
  768. 'subtract-corresponding',
  769. 'suffix',
  770. 'sum',
  771. 'summary',
  772. 'summing',
  773. 'supplied',
  774. 'supply',
  775. 'suppress',
  776. 'switch',
  777. 'switchstates',
  778. 'symbol',
  779. 'syncpoints',
  780. 'syntax',
  781. 'syntax-check',
  782. 'syntax-trace',
  783. 'system-call',
  784. 'system-exceptions',
  785. 'system-exit',
  786. 'tab',
  787. 'tabbed',
  788. 'table',
  789. 'tables',
  790. 'tableview',
  791. 'tabstrip',
  792. 'target',
  793. 'task',
  794. 'tasks',
  795. 'test',
  796. 'testing',
  797. 'test-injection',
  798. 'test-seam',
  799. 'text',
  800. 'textpool',
  801. 'then',
  802. 'throw',
  803. 'time',
  804. 'times',
  805. 'timestamp',
  806. 'timezone',
  807. 'tims_is_valid',
  808. 'title',
  809. 'titlebar',
  810. 'title-lines',
  811. 'to',
  812. 'tokenization',
  813. 'tokens',
  814. 'top-lines',
  815. 'top-of-page',
  816. 'trace-file',
  817. 'trace-table',
  818. 'trailing',
  819. 'transaction',
  820. 'transfer',
  821. 'transformation',
  822. 'translate', // also a built-in
  823. 'transporting',
  824. 'trmac',
  825. 'truncate',
  826. 'truncation',
  827. 'try',
  828. 'tstmp_add_seconds',
  829. 'tstmp_current_utctimestamp',
  830. 'tstmp_is_valid',
  831. 'tstmp_seconds_between',
  832. 'type',
  833. 'type-pool',
  834. 'type-pools',
  835. 'types',
  836. 'uline',
  837. 'unassign',
  838. 'under',
  839. 'unicode',
  840. 'union',
  841. 'unique',
  842. 'unit_conversion',
  843. 'unix',
  844. 'unpack',
  845. 'until',
  846. 'unwind',
  847. 'up',
  848. 'update',
  849. 'upper',
  850. 'user',
  851. 'user-command',
  852. 'using',
  853. 'utf-8',
  854. 'valid',
  855. 'value',
  856. 'value-request',
  857. 'values',
  858. 'vary',
  859. 'varying',
  860. 'verification-message',
  861. 'version',
  862. 'via',
  863. 'view',
  864. 'visible',
  865. 'wait',
  866. 'warning',
  867. 'when',
  868. 'whenever',
  869. 'where',
  870. 'while',
  871. 'width',
  872. 'window',
  873. 'windows',
  874. 'with',
  875. 'with-heading',
  876. 'without',
  877. 'with-title',
  878. 'word',
  879. 'work',
  880. 'write',
  881. 'writer',
  882. 'xml',
  883. 'xsd',
  884. 'yellow',
  885. 'yes',
  886. 'yymmdd',
  887. 'zero',
  888. 'zone',
  889. // since 7.55:
  890. 'abap_system_timezone',
  891. 'abap_user_timezone',
  892. 'access',
  893. 'action',
  894. 'adabas',
  895. 'adjust_numbers',
  896. 'allow_precision_loss',
  897. 'allowed',
  898. 'amdp',
  899. 'applicationuser',
  900. 'as_geo_json',
  901. 'as400',
  902. 'associations',
  903. 'balance',
  904. 'behavior',
  905. 'breakup',
  906. 'bulk',
  907. 'cds',
  908. 'cds_client',
  909. 'check_before_save',
  910. 'child',
  911. 'clients',
  912. 'corr',
  913. 'corr_spearman',
  914. 'cross',
  915. 'cycles',
  916. 'datn_add_days',
  917. 'datn_add_months',
  918. 'datn_days_between',
  919. 'dats_from_datn',
  920. 'dats_tims_to_tstmp',
  921. 'dats_to_datn',
  922. 'db2',
  923. 'db6',
  924. 'ddl',
  925. 'dense_rank',
  926. 'depth',
  927. 'deterministic',
  928. 'discarding',
  929. 'entities',
  930. 'entity',
  931. 'error',
  932. 'failed',
  933. 'finalize',
  934. 'first_value',
  935. 'fltp_to_dec',
  936. 'following',
  937. 'fractional',
  938. 'full',
  939. 'graph',
  940. 'grouping',
  941. 'hierarchy',
  942. 'hierarchy_ancestors',
  943. 'hierarchy_ancestors_aggregate',
  944. 'hierarchy_descendants',
  945. 'hierarchy_descendants_aggregate',
  946. 'hierarchy_siblings',
  947. 'incremental',
  948. 'indicators',
  949. 'lag',
  950. 'last_value',
  951. 'lead',
  952. 'leaves',
  953. 'like_regexpr',
  954. 'link',
  955. 'locale_sap',
  956. 'lock',
  957. 'locks',
  958. 'many',
  959. 'mapped',
  960. 'matched',
  961. 'measures',
  962. 'median',
  963. 'mssqlnt',
  964. 'multiple',
  965. 'nodetype',
  966. 'ntile',
  967. 'nulls',
  968. 'occurrences_regexpr',
  969. 'one',
  970. 'operations',
  971. 'oracle',
  972. 'orphans',
  973. 'over',
  974. 'parent',
  975. 'parents',
  976. 'partition',
  977. 'pcre',
  978. 'period',
  979. 'pfcg_mapping',
  980. 'preceding',
  981. 'privileged',
  982. 'product',
  983. 'projection',
  984. 'rank',
  985. 'redirected',
  986. 'replace_regexpr',
  987. 'reported',
  988. 'response',
  989. 'responses',
  990. 'root',
  991. 'row',
  992. 'row_number',
  993. 'sap_system_date',
  994. 'save',
  995. 'schema',
  996. 'session',
  997. 'sets',
  998. 'shortdump',
  999. 'siblings',
  1000. 'spantree',
  1001. 'start',
  1002. 'stddev',
  1003. 'string_agg',
  1004. 'subtotal',
  1005. 'sybase',
  1006. 'tims_from_timn',
  1007. 'tims_to_timn',
  1008. 'to_blob',
  1009. 'to_clob',
  1010. 'total',
  1011. 'trace-entry',
  1012. 'tstmp_to_dats',
  1013. 'tstmp_to_dst',
  1014. 'tstmp_to_tims',
  1015. 'tstmpl_from_utcl',
  1016. 'tstmpl_to_utcl',
  1017. 'unbounded',
  1018. 'utcl_add_seconds',
  1019. 'utcl_current',
  1020. 'utcl_seconds_between',
  1021. 'uuid',
  1022. 'var',
  1023. 'verbatim'
  1024. ],
  1025. //
  1026. // Built-in Functions
  1027. //
  1028. // Functions that are also statements have been moved to keywords
  1029. //
  1030. builtinFunctions: [
  1031. 'abs',
  1032. 'acos',
  1033. 'asin',
  1034. 'atan',
  1035. 'bit-set',
  1036. 'boolc',
  1037. 'boolx',
  1038. 'ceil',
  1039. 'char_off',
  1040. 'charlen',
  1041. 'cmax',
  1042. 'cmin',
  1043. 'concat_lines_of',
  1044. // 'condense', // moved to keywords
  1045. 'contains',
  1046. 'contains_any_not_of',
  1047. 'contains_any_of',
  1048. 'cos',
  1049. 'cosh',
  1050. 'count',
  1051. 'count_any_not_of',
  1052. 'count_any_of',
  1053. 'dbmaxlen',
  1054. 'distance',
  1055. 'escape',
  1056. 'exp',
  1057. // 'find', // moved to keywords
  1058. 'find_any_not_of',
  1059. 'find_any_of',
  1060. 'find_end',
  1061. 'floor',
  1062. 'frac',
  1063. 'from_mixed',
  1064. // 'insert', // moved to keywords
  1065. 'ipow',
  1066. 'line_exists',
  1067. 'line_index',
  1068. // 'lines', // moved to keywords
  1069. 'log',
  1070. 'log10',
  1071. // 'match', // moved to keywords
  1072. 'matches',
  1073. 'nmax',
  1074. 'nmin',
  1075. 'numofchar',
  1076. 'repeat',
  1077. // 'replace', // moved to keywords
  1078. 'rescale',
  1079. 'reverse',
  1080. 'round',
  1081. 'segment',
  1082. 'shift_left',
  1083. 'shift_right',
  1084. 'sign',
  1085. 'sin',
  1086. 'sinh',
  1087. 'sqrt',
  1088. 'strlen',
  1089. 'substring',
  1090. 'substring_after',
  1091. 'substring_before',
  1092. 'substring_from',
  1093. 'substring_to',
  1094. 'tan',
  1095. 'tanh',
  1096. 'to_lower',
  1097. 'to_mixed',
  1098. 'to_upper',
  1099. // 'translate', // moved to keywords
  1100. 'trunc',
  1101. 'utclong_add', // since 7.54
  1102. 'utclong_current', // since 7.54
  1103. 'utclong_diff', // since 7.54
  1104. 'xsdbool',
  1105. 'xstrlen'
  1106. ],
  1107. //
  1108. // Data Types
  1109. //
  1110. // Data types that are also part of statements have been moved to keywords
  1111. //
  1112. typeKeywords: [
  1113. // built-in abap types
  1114. 'b',
  1115. 'c',
  1116. 'd',
  1117. 'decfloat16',
  1118. 'decfloat34',
  1119. 'f',
  1120. 'i',
  1121. 'int8', // since 7.54
  1122. 'n',
  1123. 'p',
  1124. 's',
  1125. 'string',
  1126. 't',
  1127. 'utclong', // since 7.54
  1128. 'x',
  1129. 'xstring',
  1130. // generic data types
  1131. 'any',
  1132. 'clike',
  1133. 'csequence',
  1134. 'decfloat',
  1135. // 'object', // moved to keywords
  1136. 'numeric',
  1137. 'simple',
  1138. 'xsequence',
  1139. // ddic/sql data types
  1140. 'accp',
  1141. 'char',
  1142. 'clnt',
  1143. 'cuky',
  1144. 'curr',
  1145. 'datn', // since 7.55
  1146. 'dats',
  1147. 'd16d', // since 7.55
  1148. 'd16n', // since 7.55
  1149. 'd16r', // since 7.55
  1150. 'd34d', // since 7.55
  1151. 'd34n', // since 7.55
  1152. 'd34r', // since 7.55
  1153. 'dec',
  1154. 'df16_dec',
  1155. 'df16_raw',
  1156. 'df34_dec',
  1157. 'df34_raw',
  1158. 'fltp',
  1159. 'geom_ewkb', // since 7.55
  1160. 'int1',
  1161. 'int2',
  1162. 'int4',
  1163. 'lang',
  1164. 'lchr',
  1165. 'lraw',
  1166. 'numc',
  1167. 'quan',
  1168. 'raw',
  1169. 'rawstring',
  1170. 'sstring',
  1171. 'timn', // since 7.55
  1172. 'tims',
  1173. 'unit',
  1174. 'utcl', // since 7.55
  1175. // ddic data types (obsolete)
  1176. 'df16_scl',
  1177. 'df34_scl',
  1178. 'prec',
  1179. 'varc',
  1180. // special data types and constants
  1181. 'abap_bool',
  1182. 'abap_false',
  1183. 'abap_true',
  1184. 'abap_undefined',
  1185. 'me',
  1186. 'screen',
  1187. 'space',
  1188. 'super',
  1189. 'sy',
  1190. 'syst',
  1191. 'table_line',
  1192. // obsolete data object
  1193. '*sys*'
  1194. ],
  1195. builtinMethods: ['class_constructor', 'constructor'],
  1196. derivedTypes: [
  1197. '%CID',
  1198. '%CID_REF',
  1199. '%CONTROL',
  1200. '%DATA',
  1201. '%ELEMENT',
  1202. '%FAIL',
  1203. '%KEY',
  1204. '%MSG',
  1205. '%PARAM',
  1206. '%PID',
  1207. '%PID_ASSOC',
  1208. '%PID_PARENT',
  1209. '%_HINTS'
  1210. ],
  1211. cdsLanguage: [
  1212. '@AbapAnnotation',
  1213. '@AbapCatalog',
  1214. '@AccessControl',
  1215. '@API',
  1216. '@ClientDependent',
  1217. '@ClientHandling',
  1218. '@CompatibilityContract',
  1219. '@DataAging',
  1220. '@EndUserText',
  1221. '@Environment',
  1222. '@LanguageDependency',
  1223. '@MappingRole',
  1224. '@Metadata',
  1225. '@MetadataExtension',
  1226. '@ObjectModel',
  1227. '@Scope',
  1228. '@Semantics',
  1229. '$EXTENSION',
  1230. '$SELF'
  1231. ],
  1232. selectors: ['->', '->*', '=>', '~', '~*'],
  1233. //
  1234. // Operators
  1235. //
  1236. // Operators that can be part of statements have been moved to keywords
  1237. //
  1238. operators: [
  1239. // arithmetic operators
  1240. ' +',
  1241. ' -',
  1242. '/',
  1243. '*',
  1244. '**',
  1245. 'div',
  1246. 'mod',
  1247. // assignment operators
  1248. '=',
  1249. '#',
  1250. '@',
  1251. '+=',
  1252. '-=',
  1253. '*=',
  1254. '/=',
  1255. '**=',
  1256. '&&=',
  1257. // casting operator
  1258. '?=',
  1259. // concat operators
  1260. '&',
  1261. '&&',
  1262. // bit operators
  1263. 'bit-and',
  1264. 'bit-not',
  1265. 'bit-or',
  1266. 'bit-xor',
  1267. 'm',
  1268. 'o',
  1269. 'z',
  1270. // boolean operators
  1271. // 'and', // moved to keywords
  1272. // 'equiv', // moved to keywords
  1273. // 'not', // moved to keywords
  1274. // 'or', // moved to keywords
  1275. // comparison operators
  1276. '<',
  1277. ' >', // todo: separate from -> and =>
  1278. '<=',
  1279. '>=',
  1280. '<>',
  1281. '><', // obsolete
  1282. '=<', // obsolete
  1283. '=>', // obsolete
  1284. // 'between', // moved to keywords
  1285. 'bt',
  1286. 'byte-ca',
  1287. 'byte-cn',
  1288. 'byte-co',
  1289. 'byte-cs',
  1290. 'byte-na',
  1291. 'byte-ns',
  1292. 'ca',
  1293. 'cn',
  1294. 'co',
  1295. 'cp',
  1296. 'cs',
  1297. 'eq', // obsolete
  1298. 'ge', // obsolete
  1299. 'gt', // obsolete
  1300. // 'in', // moved to keywords
  1301. 'le', // obsolete
  1302. 'lt', // obsolete
  1303. 'na',
  1304. 'nb',
  1305. 'ne', // obsolete
  1306. 'np',
  1307. 'ns',
  1308. // cds
  1309. '*/',
  1310. '*:',
  1311. '--',
  1312. '/*',
  1313. '//'
  1314. ],
  1315. symbols: /[=><!~?&+\-*\/\^%#@]+/,
  1316. tokenizer: {
  1317. root: [
  1318. [
  1319. /[a-z_\/$%@]([\w\/$%]|-(?!>))*/, // exclude '->' selector
  1320. {
  1321. cases: {
  1322. '@typeKeywords': 'type',
  1323. '@keywords': 'keyword',
  1324. '@cdsLanguage': 'annotation',
  1325. '@derivedTypes': 'type',
  1326. '@builtinFunctions': 'type',
  1327. '@builtinMethods': 'type',
  1328. '@operators': 'key',
  1329. '@default': 'identifier'
  1330. }
  1331. }
  1332. ],
  1333. [/<[\w]+>/, 'identifier'], // field symbols
  1334. [/##[\w|_]+/, 'comment'], // pragmas
  1335. { include: '@whitespace' },
  1336. [/[:,.]/, 'delimiter'],
  1337. [/[{}()\[\]]/, '@brackets'],
  1338. [
  1339. /@symbols/,
  1340. {
  1341. cases: {
  1342. '@selectors': 'tag',
  1343. '@operators': 'key',
  1344. '@default': ''
  1345. }
  1346. }
  1347. ],
  1348. [/'/, { token: 'string', bracket: '@open', next: '@stringquote' }],
  1349. [/`/, { token: 'string', bracket: '@open', next: '@stringping' }],
  1350. [/\|/, { token: 'string', bracket: '@open', next: '@stringtemplate' }],
  1351. [/\d+/, 'number']
  1352. ],
  1353. stringtemplate: [
  1354. [/[^\\\|]+/, 'string'],
  1355. [/\\\|/, 'string'],
  1356. [/\|/, { token: 'string', bracket: '@close', next: '@pop' }]
  1357. ],
  1358. stringping: [
  1359. [/[^\\`]+/, 'string'],
  1360. [/`/, { token: 'string', bracket: '@close', next: '@pop' }]
  1361. ],
  1362. stringquote: [
  1363. [/[^\\']+/, 'string'],
  1364. [/'/, { token: 'string', bracket: '@close', next: '@pop' }]
  1365. ],
  1366. whitespace: [
  1367. [/[ \t\r\n]+/, ''],
  1368. [/^\*.*$/, 'comment'],
  1369. [/\".*$/, 'comment']
  1370. ]
  1371. }
  1372. };