ecl.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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. define('vs/basic-languages/ecl/ecl',["require", "exports"], function (require, exports) {
  6. "use strict";
  7. Object.defineProperty(exports, "__esModule", { value: true });
  8. exports.language = exports.conf = void 0;
  9. exports.conf = {
  10. comments: {
  11. lineComment: '//',
  12. blockComment: ['/*', '*/']
  13. },
  14. brackets: [
  15. ['{', '}'],
  16. ['[', ']'],
  17. ['(', ')']
  18. ],
  19. autoClosingPairs: [
  20. { open: '{', close: '}' },
  21. { open: '[', close: ']' },
  22. { open: '(', close: ')' },
  23. { open: "'", close: "'", notIn: ['string', 'comment'] },
  24. { open: '"', close: '"', notIn: ['string', 'comment'] }
  25. ],
  26. surroundingPairs: [
  27. { open: '{', close: '}' },
  28. { open: '[', close: ']' },
  29. { open: '(', close: ')' },
  30. { open: '<', close: '>' },
  31. { open: "'", close: "'" },
  32. { open: '"', close: '"' }
  33. ]
  34. };
  35. exports.language = {
  36. defaultToken: '',
  37. tokenPostfix: '.ecl',
  38. ignoreCase: true,
  39. brackets: [
  40. { open: '{', close: '}', token: 'delimiter.curly' },
  41. { open: '[', close: ']', token: 'delimiter.square' },
  42. { open: '(', close: ')', token: 'delimiter.parenthesis' },
  43. { open: '<', close: '>', token: 'delimiter.angle' }
  44. ],
  45. pounds: [
  46. 'append',
  47. 'break',
  48. 'declare',
  49. 'demangle',
  50. 'end',
  51. 'for',
  52. 'getdatatype',
  53. 'if',
  54. 'inmodule',
  55. 'loop',
  56. 'mangle',
  57. 'onwarning',
  58. 'option',
  59. 'set',
  60. 'stored',
  61. 'uniquename'
  62. ].join('|'),
  63. keywords: [
  64. '__compressed__',
  65. 'after',
  66. 'all',
  67. 'and',
  68. 'any',
  69. 'as',
  70. 'atmost',
  71. 'before',
  72. 'beginc',
  73. 'best',
  74. 'between',
  75. 'case',
  76. 'cluster',
  77. 'compressed',
  78. 'compression',
  79. 'const',
  80. 'counter',
  81. 'csv',
  82. 'default',
  83. 'descend',
  84. 'embed',
  85. 'encoding',
  86. 'encrypt',
  87. 'end',
  88. 'endc',
  89. 'endembed',
  90. 'endmacro',
  91. 'enum',
  92. 'escape',
  93. 'except',
  94. 'exclusive',
  95. 'expire',
  96. 'export',
  97. 'extend',
  98. 'fail',
  99. 'few',
  100. 'fileposition',
  101. 'first',
  102. 'flat',
  103. 'forward',
  104. 'from',
  105. 'full',
  106. 'function',
  107. 'functionmacro',
  108. 'group',
  109. 'grouped',
  110. 'heading',
  111. 'hole',
  112. 'ifblock',
  113. 'import',
  114. 'in',
  115. 'inner',
  116. 'interface',
  117. 'internal',
  118. 'joined',
  119. 'keep',
  120. 'keyed',
  121. 'last',
  122. 'left',
  123. 'limit',
  124. 'linkcounted',
  125. 'literal',
  126. 'little_endian',
  127. 'load',
  128. 'local',
  129. 'locale',
  130. 'lookup',
  131. 'lzw',
  132. 'macro',
  133. 'many',
  134. 'maxcount',
  135. 'maxlength',
  136. 'min skew',
  137. 'module',
  138. 'mofn',
  139. 'multiple',
  140. 'named',
  141. 'namespace',
  142. 'nocase',
  143. 'noroot',
  144. 'noscan',
  145. 'nosort',
  146. 'not',
  147. 'noxpath',
  148. 'of',
  149. 'onfail',
  150. 'only',
  151. 'opt',
  152. 'or',
  153. 'outer',
  154. 'overwrite',
  155. 'packed',
  156. 'partition',
  157. 'penalty',
  158. 'physicallength',
  159. 'pipe',
  160. 'prefetch',
  161. 'quote',
  162. 'record',
  163. 'repeat',
  164. 'retry',
  165. 'return',
  166. 'right',
  167. 'right1',
  168. 'right2',
  169. 'rows',
  170. 'rowset',
  171. 'scan',
  172. 'scope',
  173. 'self',
  174. 'separator',
  175. 'service',
  176. 'shared',
  177. 'skew',
  178. 'skip',
  179. 'smart',
  180. 'soapaction',
  181. 'sql',
  182. 'stable',
  183. 'store',
  184. 'terminator',
  185. 'thor',
  186. 'threshold',
  187. 'timelimit',
  188. 'timeout',
  189. 'token',
  190. 'transform',
  191. 'trim',
  192. 'type',
  193. 'unicodeorder',
  194. 'unordered',
  195. 'unsorted',
  196. 'unstable',
  197. 'update',
  198. 'use',
  199. 'validate',
  200. 'virtual',
  201. 'whole',
  202. 'width',
  203. 'wild',
  204. 'within',
  205. 'wnotrim',
  206. 'xml',
  207. 'xpath'
  208. ],
  209. functions: [
  210. 'abs',
  211. 'acos',
  212. 'aggregate',
  213. 'allnodes',
  214. 'apply',
  215. 'ascii',
  216. 'asin',
  217. 'assert',
  218. 'asstring',
  219. 'atan',
  220. 'atan2',
  221. 'ave',
  222. 'build',
  223. 'buildindex',
  224. 'case',
  225. 'catch',
  226. 'choose',
  227. 'choosen',
  228. 'choosesets',
  229. 'clustersize',
  230. 'combine',
  231. 'correlation',
  232. 'cos',
  233. 'cosh',
  234. 'count',
  235. 'covariance',
  236. 'cron',
  237. 'dataset',
  238. 'dedup',
  239. 'define',
  240. 'denormalize',
  241. 'dictionary',
  242. 'distribute',
  243. 'distributed',
  244. 'distribution',
  245. 'ebcdic',
  246. 'enth',
  247. 'error',
  248. 'evaluate',
  249. 'event',
  250. 'eventextra',
  251. 'eventname',
  252. 'exists',
  253. 'exp',
  254. 'fail',
  255. 'failcode',
  256. 'failmessage',
  257. 'fetch',
  258. 'fromunicode',
  259. 'fromxml',
  260. 'getenv',
  261. 'getisvalid',
  262. 'global',
  263. 'graph',
  264. 'group',
  265. 'hash',
  266. 'hash32',
  267. 'hash64',
  268. 'hashcrc',
  269. 'hashmd5',
  270. 'having',
  271. 'httpcall',
  272. 'httpheader',
  273. 'if',
  274. 'iff',
  275. 'index',
  276. 'intformat',
  277. 'isvalid',
  278. 'iterate',
  279. 'join',
  280. 'keydiff',
  281. 'keypatch',
  282. 'keyunicode',
  283. 'length',
  284. 'library',
  285. 'limit',
  286. 'ln',
  287. 'loadxml',
  288. 'local',
  289. 'log',
  290. 'loop',
  291. 'map',
  292. 'matched',
  293. 'matchlength',
  294. 'matchposition',
  295. 'matchtext',
  296. 'matchunicode',
  297. 'max',
  298. 'merge',
  299. 'mergejoin',
  300. 'min',
  301. 'nofold',
  302. 'nolocal',
  303. 'nonempty',
  304. 'normalize',
  305. 'nothor',
  306. 'notify',
  307. 'output',
  308. 'parallel',
  309. 'parse',
  310. 'pipe',
  311. 'power',
  312. 'preload',
  313. 'process',
  314. 'project',
  315. 'pull',
  316. 'random',
  317. 'range',
  318. 'rank',
  319. 'ranked',
  320. 'realformat',
  321. 'recordof',
  322. 'regexfind',
  323. 'regexreplace',
  324. 'regroup',
  325. 'rejected',
  326. 'rollup',
  327. 'round',
  328. 'roundup',
  329. 'row',
  330. 'rowdiff',
  331. 'sample',
  332. 'sequential',
  333. 'set',
  334. 'sin',
  335. 'sinh',
  336. 'sizeof',
  337. 'soapcall',
  338. 'sort',
  339. 'sorted',
  340. 'sqrt',
  341. 'stepped',
  342. 'stored',
  343. 'sum',
  344. 'table',
  345. 'tan',
  346. 'tanh',
  347. 'thisnode',
  348. 'topn',
  349. 'tounicode',
  350. 'toxml',
  351. 'transfer',
  352. 'transform',
  353. 'trim',
  354. 'truncate',
  355. 'typeof',
  356. 'ungroup',
  357. 'unicodeorder',
  358. 'variance',
  359. 'wait',
  360. 'which',
  361. 'workunit',
  362. 'xmldecode',
  363. 'xmlencode',
  364. 'xmltext',
  365. 'xmlunicode'
  366. ],
  367. typesint: ['integer', 'unsigned'].join('|'),
  368. typesnum: ['data', 'qstring', 'string', 'unicode', 'utf8', 'varstring', 'varunicode'],
  369. typesone: [
  370. 'ascii',
  371. 'big_endian',
  372. 'boolean',
  373. 'data',
  374. 'decimal',
  375. 'ebcdic',
  376. 'grouped',
  377. 'integer',
  378. 'linkcounted',
  379. 'pattern',
  380. 'qstring',
  381. 'real',
  382. 'record',
  383. 'rule',
  384. 'set of',
  385. 'streamed',
  386. 'string',
  387. 'token',
  388. 'udecimal',
  389. 'unicode',
  390. 'unsigned',
  391. 'utf8',
  392. 'varstring',
  393. 'varunicode'
  394. ].join('|'),
  395. operators: ['+', '-', '/', ':=', '<', '<>', '=', '>', '\\', 'and', 'in', 'not', 'or'],
  396. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  397. // escape sequences
  398. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  399. // The main tokenizer for our languages
  400. tokenizer: {
  401. root: [
  402. [/@typesint[4|8]/, 'type'],
  403. [/#(@pounds)/, 'type'],
  404. [/@typesone/, 'type'],
  405. [
  406. /[a-zA-Z_$][\w-$]*/,
  407. {
  408. cases: {
  409. '@functions': 'keyword.function',
  410. '@keywords': 'keyword',
  411. '@operators': 'operator'
  412. }
  413. }
  414. ],
  415. // whitespace
  416. { include: '@whitespace' },
  417. [/[{}()\[\]]/, '@brackets'],
  418. [/[<>](?!@symbols)/, '@brackets'],
  419. [
  420. /@symbols/,
  421. {
  422. cases: {
  423. '@operators': 'delimiter',
  424. '@default': ''
  425. }
  426. }
  427. ],
  428. // numbers
  429. [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/, 'number.float'],
  430. [/0[xX][0-9a-fA-F_]+/, 'number.hex'],
  431. [/0[bB][01]+/, 'number.hex'],
  432. [/[0-9_]+/, 'number'],
  433. // delimiter: after number because of .\d floats
  434. [/[;,.]/, 'delimiter'],
  435. // strings
  436. [/"([^"\\]|\\.)*$/, 'string.invalid'],
  437. [/"/, 'string', '@string'],
  438. // characters
  439. [/'[^\\']'/, 'string'],
  440. [/(')(@escapes)(')/, ['string', 'string.escape', 'string']],
  441. [/'/, 'string.invalid']
  442. ],
  443. whitespace: [
  444. [/[ \t\v\f\r\n]+/, ''],
  445. [/\/\*/, 'comment', '@comment'],
  446. [/\/\/.*$/, 'comment']
  447. ],
  448. comment: [
  449. [/[^\/*]+/, 'comment'],
  450. [/\*\//, 'comment', '@pop'],
  451. [/[\/*]/, 'comment']
  452. ],
  453. string: [
  454. [/[^\\']+/, 'string'],
  455. [/@escapes/, 'string.escape'],
  456. [/\\./, 'string.escape.invalid'],
  457. [/'/, 'string', '@pop']
  458. ]
  459. }
  460. };
  461. });