idl.js 21 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: https://codemirror.net/LICENSE
  3. ;(function (mod) {
  4. if (typeof exports == 'object' && typeof module == 'object')
  5. // CommonJS
  6. mod(require('../../lib/codemirror'))
  7. else if (typeof define == 'function' && define.amd)
  8. // AMD
  9. define(['../../lib/codemirror'], mod)
  10. // Plain browser env
  11. else mod(CodeMirror)
  12. })(function (CodeMirror) {
  13. 'use strict'
  14. function wordRegexp(words) {
  15. return new RegExp('^((' + words.join(')|(') + '))\\b', 'i')
  16. }
  17. var builtinArray = [
  18. 'a_correlate',
  19. 'abs',
  20. 'acos',
  21. 'adapt_hist_equal',
  22. 'alog',
  23. 'alog2',
  24. 'alog10',
  25. 'amoeba',
  26. 'annotate',
  27. 'app_user_dir',
  28. 'app_user_dir_query',
  29. 'arg_present',
  30. 'array_equal',
  31. 'array_indices',
  32. 'arrow',
  33. 'ascii_template',
  34. 'asin',
  35. 'assoc',
  36. 'atan',
  37. 'axis',
  38. 'axis',
  39. 'bandpass_filter',
  40. 'bandreject_filter',
  41. 'barplot',
  42. 'bar_plot',
  43. 'beseli',
  44. 'beselj',
  45. 'beselk',
  46. 'besely',
  47. 'beta',
  48. 'biginteger',
  49. 'bilinear',
  50. 'bin_date',
  51. 'binary_template',
  52. 'bindgen',
  53. 'binomial',
  54. 'bit_ffs',
  55. 'bit_population',
  56. 'blas_axpy',
  57. 'blk_con',
  58. 'boolarr',
  59. 'boolean',
  60. 'boxplot',
  61. 'box_cursor',
  62. 'breakpoint',
  63. 'broyden',
  64. 'bubbleplot',
  65. 'butterworth',
  66. 'bytarr',
  67. 'byte',
  68. 'byteorder',
  69. 'bytscl',
  70. 'c_correlate',
  71. 'calendar',
  72. 'caldat',
  73. 'call_external',
  74. 'call_function',
  75. 'call_method',
  76. 'call_procedure',
  77. 'canny',
  78. 'catch',
  79. 'cd',
  80. 'cdf',
  81. 'ceil',
  82. 'chebyshev',
  83. 'check_math',
  84. 'chisqr_cvf',
  85. 'chisqr_pdf',
  86. 'choldc',
  87. 'cholsol',
  88. 'cindgen',
  89. 'cir_3pnt',
  90. 'clipboard',
  91. 'close',
  92. 'clust_wts',
  93. 'cluster',
  94. 'cluster_tree',
  95. 'cmyk_convert',
  96. 'code_coverage',
  97. 'color_convert',
  98. 'color_exchange',
  99. 'color_quan',
  100. 'color_range_map',
  101. 'colorbar',
  102. 'colorize_sample',
  103. 'colormap_applicable',
  104. 'colormap_gradient',
  105. 'colormap_rotation',
  106. 'colortable',
  107. 'comfit',
  108. 'command_line_args',
  109. 'common',
  110. 'compile_opt',
  111. 'complex',
  112. 'complexarr',
  113. 'complexround',
  114. 'compute_mesh_normals',
  115. 'cond',
  116. 'congrid',
  117. 'conj',
  118. 'constrained_min',
  119. 'contour',
  120. 'contour',
  121. 'convert_coord',
  122. 'convol',
  123. 'convol_fft',
  124. 'coord2to3',
  125. 'copy_lun',
  126. 'correlate',
  127. 'cos',
  128. 'cosh',
  129. 'cpu',
  130. 'cramer',
  131. 'createboxplotdata',
  132. 'create_cursor',
  133. 'create_struct',
  134. 'create_view',
  135. 'crossp',
  136. 'crvlength',
  137. 'ct_luminance',
  138. 'cti_test',
  139. 'cursor',
  140. 'curvefit',
  141. 'cv_coord',
  142. 'cvttobm',
  143. 'cw_animate',
  144. 'cw_animate_getp',
  145. 'cw_animate_load',
  146. 'cw_animate_run',
  147. 'cw_arcball',
  148. 'cw_bgroup',
  149. 'cw_clr_index',
  150. 'cw_colorsel',
  151. 'cw_defroi',
  152. 'cw_field',
  153. 'cw_filesel',
  154. 'cw_form',
  155. 'cw_fslider',
  156. 'cw_light_editor',
  157. 'cw_light_editor_get',
  158. 'cw_light_editor_set',
  159. 'cw_orient',
  160. 'cw_palette_editor',
  161. 'cw_palette_editor_get',
  162. 'cw_palette_editor_set',
  163. 'cw_pdmenu',
  164. 'cw_rgbslider',
  165. 'cw_tmpl',
  166. 'cw_zoom',
  167. 'db_exists',
  168. 'dblarr',
  169. 'dcindgen',
  170. 'dcomplex',
  171. 'dcomplexarr',
  172. 'define_key',
  173. 'define_msgblk',
  174. 'define_msgblk_from_file',
  175. 'defroi',
  176. 'defsysv',
  177. 'delvar',
  178. 'dendro_plot',
  179. 'dendrogram',
  180. 'deriv',
  181. 'derivsig',
  182. 'determ',
  183. 'device',
  184. 'dfpmin',
  185. 'diag_matrix',
  186. 'dialog_dbconnect',
  187. 'dialog_message',
  188. 'dialog_pickfile',
  189. 'dialog_printersetup',
  190. 'dialog_printjob',
  191. 'dialog_read_image',
  192. 'dialog_write_image',
  193. 'dictionary',
  194. 'digital_filter',
  195. 'dilate',
  196. 'dindgen',
  197. 'dissolve',
  198. 'dist',
  199. 'distance_measure',
  200. 'dlm_load',
  201. 'dlm_register',
  202. 'doc_library',
  203. 'double',
  204. 'draw_roi',
  205. 'edge_dog',
  206. 'efont',
  207. 'eigenql',
  208. 'eigenvec',
  209. 'ellipse',
  210. 'elmhes',
  211. 'emboss',
  212. 'empty',
  213. 'enable_sysrtn',
  214. 'eof',
  215. 'eos',
  216. 'erase',
  217. 'erf',
  218. 'erfc',
  219. 'erfcx',
  220. 'erode',
  221. 'errorplot',
  222. 'errplot',
  223. 'estimator_filter',
  224. 'execute',
  225. 'exit',
  226. 'exp',
  227. 'expand',
  228. 'expand_path',
  229. 'expint',
  230. 'extract',
  231. 'extract_slice',
  232. 'f_cvf',
  233. 'f_pdf',
  234. 'factorial',
  235. 'fft',
  236. 'file_basename',
  237. 'file_chmod',
  238. 'file_copy',
  239. 'file_delete',
  240. 'file_dirname',
  241. 'file_expand_path',
  242. 'file_gunzip',
  243. 'file_gzip',
  244. 'file_info',
  245. 'file_lines',
  246. 'file_link',
  247. 'file_mkdir',
  248. 'file_move',
  249. 'file_poll_input',
  250. 'file_readlink',
  251. 'file_same',
  252. 'file_search',
  253. 'file_tar',
  254. 'file_test',
  255. 'file_untar',
  256. 'file_unzip',
  257. 'file_which',
  258. 'file_zip',
  259. 'filepath',
  260. 'findgen',
  261. 'finite',
  262. 'fix',
  263. 'flick',
  264. 'float',
  265. 'floor',
  266. 'flow3',
  267. 'fltarr',
  268. 'flush',
  269. 'format_axis_values',
  270. 'forward_function',
  271. 'free_lun',
  272. 'fstat',
  273. 'fulstr',
  274. 'funct',
  275. 'function',
  276. 'fv_test',
  277. 'fx_root',
  278. 'fz_roots',
  279. 'gamma',
  280. 'gamma_ct',
  281. 'gauss_cvf',
  282. 'gauss_pdf',
  283. 'gauss_smooth',
  284. 'gauss2dfit',
  285. 'gaussfit',
  286. 'gaussian_function',
  287. 'gaussint',
  288. 'get_drive_list',
  289. 'get_dxf_objects',
  290. 'get_kbrd',
  291. 'get_login_info',
  292. 'get_lun',
  293. 'get_screen_size',
  294. 'getenv',
  295. 'getwindows',
  296. 'greg2jul',
  297. 'grib',
  298. 'grid_input',
  299. 'grid_tps',
  300. 'grid3',
  301. 'griddata',
  302. 'gs_iter',
  303. 'h_eq_ct',
  304. 'h_eq_int',
  305. 'hanning',
  306. 'hash',
  307. 'hdf',
  308. 'hdf5',
  309. 'heap_free',
  310. 'heap_gc',
  311. 'heap_nosave',
  312. 'heap_refcount',
  313. 'heap_save',
  314. 'help',
  315. 'hilbert',
  316. 'hist_2d',
  317. 'hist_equal',
  318. 'histogram',
  319. 'hls',
  320. 'hough',
  321. 'hqr',
  322. 'hsv',
  323. 'i18n_multibytetoutf8',
  324. 'i18n_multibytetowidechar',
  325. 'i18n_utf8tomultibyte',
  326. 'i18n_widechartomultibyte',
  327. 'ibeta',
  328. 'icontour',
  329. 'iconvertcoord',
  330. 'idelete',
  331. 'identity',
  332. 'idl_base64',
  333. 'idl_container',
  334. 'idl_validname',
  335. 'idlexbr_assistant',
  336. 'idlitsys_createtool',
  337. 'idlunit',
  338. 'iellipse',
  339. 'igamma',
  340. 'igetcurrent',
  341. 'igetdata',
  342. 'igetid',
  343. 'igetproperty',
  344. 'iimage',
  345. 'image',
  346. 'image_cont',
  347. 'image_statistics',
  348. 'image_threshold',
  349. 'imaginary',
  350. 'imap',
  351. 'indgen',
  352. 'int_2d',
  353. 'int_3d',
  354. 'int_tabulated',
  355. 'intarr',
  356. 'interpol',
  357. 'interpolate',
  358. 'interval_volume',
  359. 'invert',
  360. 'ioctl',
  361. 'iopen',
  362. 'ir_filter',
  363. 'iplot',
  364. 'ipolygon',
  365. 'ipolyline',
  366. 'iputdata',
  367. 'iregister',
  368. 'ireset',
  369. 'iresolve',
  370. 'irotate',
  371. 'isa',
  372. 'isave',
  373. 'iscale',
  374. 'isetcurrent',
  375. 'isetproperty',
  376. 'ishft',
  377. 'isocontour',
  378. 'isosurface',
  379. 'isurface',
  380. 'itext',
  381. 'itranslate',
  382. 'ivector',
  383. 'ivolume',
  384. 'izoom',
  385. 'journal',
  386. 'json_parse',
  387. 'json_serialize',
  388. 'jul2greg',
  389. 'julday',
  390. 'keyword_set',
  391. 'krig2d',
  392. 'kurtosis',
  393. 'kw_test',
  394. 'l64indgen',
  395. 'la_choldc',
  396. 'la_cholmprove',
  397. 'la_cholsol',
  398. 'la_determ',
  399. 'la_eigenproblem',
  400. 'la_eigenql',
  401. 'la_eigenvec',
  402. 'la_elmhes',
  403. 'la_gm_linear_model',
  404. 'la_hqr',
  405. 'la_invert',
  406. 'la_least_square_equality',
  407. 'la_least_squares',
  408. 'la_linear_equation',
  409. 'la_ludc',
  410. 'la_lumprove',
  411. 'la_lusol',
  412. 'la_svd',
  413. 'la_tridc',
  414. 'la_trimprove',
  415. 'la_triql',
  416. 'la_trired',
  417. 'la_trisol',
  418. 'label_date',
  419. 'label_region',
  420. 'ladfit',
  421. 'laguerre',
  422. 'lambda',
  423. 'lambdap',
  424. 'lambertw',
  425. 'laplacian',
  426. 'least_squares_filter',
  427. 'leefilt',
  428. 'legend',
  429. 'legendre',
  430. 'linbcg',
  431. 'lindgen',
  432. 'linfit',
  433. 'linkimage',
  434. 'list',
  435. 'll_arc_distance',
  436. 'lmfit',
  437. 'lmgr',
  438. 'lngamma',
  439. 'lnp_test',
  440. 'loadct',
  441. 'locale_get',
  442. 'logical_and',
  443. 'logical_or',
  444. 'logical_true',
  445. 'lon64arr',
  446. 'lonarr',
  447. 'long',
  448. 'long64',
  449. 'lsode',
  450. 'lu_complex',
  451. 'ludc',
  452. 'lumprove',
  453. 'lusol',
  454. 'm_correlate',
  455. 'machar',
  456. 'make_array',
  457. 'make_dll',
  458. 'make_rt',
  459. 'map',
  460. 'mapcontinents',
  461. 'mapgrid',
  462. 'map_2points',
  463. 'map_continents',
  464. 'map_grid',
  465. 'map_image',
  466. 'map_patch',
  467. 'map_proj_forward',
  468. 'map_proj_image',
  469. 'map_proj_info',
  470. 'map_proj_init',
  471. 'map_proj_inverse',
  472. 'map_set',
  473. 'matrix_multiply',
  474. 'matrix_power',
  475. 'max',
  476. 'md_test',
  477. 'mean',
  478. 'meanabsdev',
  479. 'mean_filter',
  480. 'median',
  481. 'memory',
  482. 'mesh_clip',
  483. 'mesh_decimate',
  484. 'mesh_issolid',
  485. 'mesh_merge',
  486. 'mesh_numtriangles',
  487. 'mesh_obj',
  488. 'mesh_smooth',
  489. 'mesh_surfacearea',
  490. 'mesh_validate',
  491. 'mesh_volume',
  492. 'message',
  493. 'min',
  494. 'min_curve_surf',
  495. 'mk_html_help',
  496. 'modifyct',
  497. 'moment',
  498. 'morph_close',
  499. 'morph_distance',
  500. 'morph_gradient',
  501. 'morph_hitormiss',
  502. 'morph_open',
  503. 'morph_thin',
  504. 'morph_tophat',
  505. 'multi',
  506. 'n_elements',
  507. 'n_params',
  508. 'n_tags',
  509. 'ncdf',
  510. 'newton',
  511. 'noise_hurl',
  512. 'noise_pick',
  513. 'noise_scatter',
  514. 'noise_slur',
  515. 'norm',
  516. 'obj_class',
  517. 'obj_destroy',
  518. 'obj_hasmethod',
  519. 'obj_isa',
  520. 'obj_new',
  521. 'obj_valid',
  522. 'objarr',
  523. 'on_error',
  524. 'on_ioerror',
  525. 'online_help',
  526. 'openr',
  527. 'openu',
  528. 'openw',
  529. 'oplot',
  530. 'oploterr',
  531. 'orderedhash',
  532. 'p_correlate',
  533. 'parse_url',
  534. 'particle_trace',
  535. 'path_cache',
  536. 'path_sep',
  537. 'pcomp',
  538. 'plot',
  539. 'plot3d',
  540. 'plot',
  541. 'plot_3dbox',
  542. 'plot_field',
  543. 'ploterr',
  544. 'plots',
  545. 'polar_contour',
  546. 'polar_surface',
  547. 'polyfill',
  548. 'polyshade',
  549. 'pnt_line',
  550. 'point_lun',
  551. 'polarplot',
  552. 'poly',
  553. 'poly_2d',
  554. 'poly_area',
  555. 'poly_fit',
  556. 'polyfillv',
  557. 'polygon',
  558. 'polyline',
  559. 'polywarp',
  560. 'popd',
  561. 'powell',
  562. 'pref_commit',
  563. 'pref_get',
  564. 'pref_set',
  565. 'prewitt',
  566. 'primes',
  567. 'print',
  568. 'printf',
  569. 'printd',
  570. 'pro',
  571. 'product',
  572. 'profile',
  573. 'profiler',
  574. 'profiles',
  575. 'project_vol',
  576. 'ps_show_fonts',
  577. 'psafm',
  578. 'pseudo',
  579. 'ptr_free',
  580. 'ptr_new',
  581. 'ptr_valid',
  582. 'ptrarr',
  583. 'pushd',
  584. 'qgrid3',
  585. 'qhull',
  586. 'qromb',
  587. 'qromo',
  588. 'qsimp',
  589. 'query_*',
  590. 'query_ascii',
  591. 'query_bmp',
  592. 'query_csv',
  593. 'query_dicom',
  594. 'query_gif',
  595. 'query_image',
  596. 'query_jpeg',
  597. 'query_jpeg2000',
  598. 'query_mrsid',
  599. 'query_pict',
  600. 'query_png',
  601. 'query_ppm',
  602. 'query_srf',
  603. 'query_tiff',
  604. 'query_video',
  605. 'query_wav',
  606. 'r_correlate',
  607. 'r_test',
  608. 'radon',
  609. 'randomn',
  610. 'randomu',
  611. 'ranks',
  612. 'rdpix',
  613. 'read',
  614. 'readf',
  615. 'read_ascii',
  616. 'read_binary',
  617. 'read_bmp',
  618. 'read_csv',
  619. 'read_dicom',
  620. 'read_gif',
  621. 'read_image',
  622. 'read_interfile',
  623. 'read_jpeg',
  624. 'read_jpeg2000',
  625. 'read_mrsid',
  626. 'read_pict',
  627. 'read_png',
  628. 'read_ppm',
  629. 'read_spr',
  630. 'read_srf',
  631. 'read_sylk',
  632. 'read_tiff',
  633. 'read_video',
  634. 'read_wav',
  635. 'read_wave',
  636. 'read_x11_bitmap',
  637. 'read_xwd',
  638. 'reads',
  639. 'readu',
  640. 'real_part',
  641. 'rebin',
  642. 'recall_commands',
  643. 'recon3',
  644. 'reduce_colors',
  645. 'reform',
  646. 'region_grow',
  647. 'register_cursor',
  648. 'regress',
  649. 'replicate',
  650. 'replicate_inplace',
  651. 'resolve_all',
  652. 'resolve_routine',
  653. 'restore',
  654. 'retall',
  655. 'return',
  656. 'reverse',
  657. 'rk4',
  658. 'roberts',
  659. 'rot',
  660. 'rotate',
  661. 'round',
  662. 'routine_filepath',
  663. 'routine_info',
  664. 'rs_test',
  665. 's_test',
  666. 'save',
  667. 'savgol',
  668. 'scale3',
  669. 'scale3d',
  670. 'scatterplot',
  671. 'scatterplot3d',
  672. 'scope_level',
  673. 'scope_traceback',
  674. 'scope_varfetch',
  675. 'scope_varname',
  676. 'search2d',
  677. 'search3d',
  678. 'sem_create',
  679. 'sem_delete',
  680. 'sem_lock',
  681. 'sem_release',
  682. 'set_plot',
  683. 'set_shading',
  684. 'setenv',
  685. 'sfit',
  686. 'shade_surf',
  687. 'shade_surf_irr',
  688. 'shade_volume',
  689. 'shift',
  690. 'shift_diff',
  691. 'shmdebug',
  692. 'shmmap',
  693. 'shmunmap',
  694. 'shmvar',
  695. 'show3',
  696. 'showfont',
  697. 'signum',
  698. 'simplex',
  699. 'sin',
  700. 'sindgen',
  701. 'sinh',
  702. 'size',
  703. 'skewness',
  704. 'skip_lun',
  705. 'slicer3',
  706. 'slide_image',
  707. 'smooth',
  708. 'sobel',
  709. 'socket',
  710. 'sort',
  711. 'spawn',
  712. 'sph_4pnt',
  713. 'sph_scat',
  714. 'spher_harm',
  715. 'spl_init',
  716. 'spl_interp',
  717. 'spline',
  718. 'spline_p',
  719. 'sprsab',
  720. 'sprsax',
  721. 'sprsin',
  722. 'sprstp',
  723. 'sqrt',
  724. 'standardize',
  725. 'stddev',
  726. 'stop',
  727. 'strarr',
  728. 'strcmp',
  729. 'strcompress',
  730. 'streamline',
  731. 'streamline',
  732. 'stregex',
  733. 'stretch',
  734. 'string',
  735. 'strjoin',
  736. 'strlen',
  737. 'strlowcase',
  738. 'strmatch',
  739. 'strmessage',
  740. 'strmid',
  741. 'strpos',
  742. 'strput',
  743. 'strsplit',
  744. 'strtrim',
  745. 'struct_assign',
  746. 'struct_hide',
  747. 'strupcase',
  748. 'surface',
  749. 'surface',
  750. 'surfr',
  751. 'svdc',
  752. 'svdfit',
  753. 'svsol',
  754. 'swap_endian',
  755. 'swap_endian_inplace',
  756. 'symbol',
  757. 'systime',
  758. 't_cvf',
  759. 't_pdf',
  760. 't3d',
  761. 'tag_names',
  762. 'tan',
  763. 'tanh',
  764. 'tek_color',
  765. 'temporary',
  766. 'terminal_size',
  767. 'tetra_clip',
  768. 'tetra_surface',
  769. 'tetra_volume',
  770. 'text',
  771. 'thin',
  772. 'thread',
  773. 'threed',
  774. 'tic',
  775. 'time_test2',
  776. 'timegen',
  777. 'timer',
  778. 'timestamp',
  779. 'timestamptovalues',
  780. 'tm_test',
  781. 'toc',
  782. 'total',
  783. 'trace',
  784. 'transpose',
  785. 'tri_surf',
  786. 'triangulate',
  787. 'trigrid',
  788. 'triql',
  789. 'trired',
  790. 'trisol',
  791. 'truncate_lun',
  792. 'ts_coef',
  793. 'ts_diff',
  794. 'ts_fcast',
  795. 'ts_smooth',
  796. 'tv',
  797. 'tvcrs',
  798. 'tvlct',
  799. 'tvrd',
  800. 'tvscl',
  801. 'typename',
  802. 'uindgen',
  803. 'uint',
  804. 'uintarr',
  805. 'ul64indgen',
  806. 'ulindgen',
  807. 'ulon64arr',
  808. 'ulonarr',
  809. 'ulong',
  810. 'ulong64',
  811. 'uniq',
  812. 'unsharp_mask',
  813. 'usersym',
  814. 'value_locate',
  815. 'variance',
  816. 'vector',
  817. 'vector_field',
  818. 'vel',
  819. 'velovect',
  820. 'vert_t3d',
  821. 'voigt',
  822. 'volume',
  823. 'voronoi',
  824. 'voxel_proj',
  825. 'wait',
  826. 'warp_tri',
  827. 'watershed',
  828. 'wdelete',
  829. 'wf_draw',
  830. 'where',
  831. 'widget_base',
  832. 'widget_button',
  833. 'widget_combobox',
  834. 'widget_control',
  835. 'widget_displaycontextmenu',
  836. 'widget_draw',
  837. 'widget_droplist',
  838. 'widget_event',
  839. 'widget_info',
  840. 'widget_label',
  841. 'widget_list',
  842. 'widget_propertysheet',
  843. 'widget_slider',
  844. 'widget_tab',
  845. 'widget_table',
  846. 'widget_text',
  847. 'widget_tree',
  848. 'widget_tree_move',
  849. 'widget_window',
  850. 'wiener_filter',
  851. 'window',
  852. 'window',
  853. 'write_bmp',
  854. 'write_csv',
  855. 'write_gif',
  856. 'write_image',
  857. 'write_jpeg',
  858. 'write_jpeg2000',
  859. 'write_nrif',
  860. 'write_pict',
  861. 'write_png',
  862. 'write_ppm',
  863. 'write_spr',
  864. 'write_srf',
  865. 'write_sylk',
  866. 'write_tiff',
  867. 'write_video',
  868. 'write_wav',
  869. 'write_wave',
  870. 'writeu',
  871. 'wset',
  872. 'wshow',
  873. 'wtn',
  874. 'wv_applet',
  875. 'wv_cwt',
  876. 'wv_cw_wavelet',
  877. 'wv_denoise',
  878. 'wv_dwt',
  879. 'wv_fn_coiflet',
  880. 'wv_fn_daubechies',
  881. 'wv_fn_gaussian',
  882. 'wv_fn_haar',
  883. 'wv_fn_morlet',
  884. 'wv_fn_paul',
  885. 'wv_fn_symlet',
  886. 'wv_import_data',
  887. 'wv_import_wavelet',
  888. 'wv_plot3d_wps',
  889. 'wv_plot_multires',
  890. 'wv_pwt',
  891. 'wv_tool_denoise',
  892. 'xbm_edit',
  893. 'xdisplayfile',
  894. 'xdxf',
  895. 'xfont',
  896. 'xinteranimate',
  897. 'xloadct',
  898. 'xmanager',
  899. 'xmng_tmpl',
  900. 'xmtool',
  901. 'xobjview',
  902. 'xobjview_rotate',
  903. 'xobjview_write_image',
  904. 'xpalette',
  905. 'xpcolor',
  906. 'xplot3d',
  907. 'xregistered',
  908. 'xroi',
  909. 'xsq_test',
  910. 'xsurface',
  911. 'xvaredit',
  912. 'xvolume',
  913. 'xvolume_rotate',
  914. 'xvolume_write_image',
  915. 'xyouts',
  916. 'zlib_compress',
  917. 'zlib_uncompress',
  918. 'zoom',
  919. 'zoom_24',
  920. ]
  921. var builtins = wordRegexp(builtinArray)
  922. var keywordArray = [
  923. 'begin',
  924. 'end',
  925. 'endcase',
  926. 'endfor',
  927. 'endwhile',
  928. 'endif',
  929. 'endrep',
  930. 'endforeach',
  931. 'break',
  932. 'case',
  933. 'continue',
  934. 'for',
  935. 'foreach',
  936. 'goto',
  937. 'if',
  938. 'then',
  939. 'else',
  940. 'repeat',
  941. 'until',
  942. 'switch',
  943. 'while',
  944. 'do',
  945. 'pro',
  946. 'function',
  947. ]
  948. var keywords = wordRegexp(keywordArray)
  949. CodeMirror.registerHelper('hintWords', 'idl', builtinArray.concat(keywordArray))
  950. var identifiers = new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*', 'i')
  951. var singleOperators = /[+\-*&=<>\/@#~$]/
  952. var boolOperators = new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)', 'i')
  953. function tokenBase(stream) {
  954. // whitespaces
  955. if (stream.eatSpace()) return null
  956. // Handle one line Comments
  957. if (stream.match(';')) {
  958. stream.skipToEnd()
  959. return 'comment'
  960. }
  961. // Handle Number Literals
  962. if (stream.match(/^[0-9\.+-]/, false)) {
  963. if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) return 'number'
  964. if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) return 'number'
  965. if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) return 'number'
  966. }
  967. // Handle Strings
  968. if (stream.match(/^"([^"]|(""))*"/)) {
  969. return 'string'
  970. }
  971. if (stream.match(/^'([^']|(''))*'/)) {
  972. return 'string'
  973. }
  974. // Handle words
  975. if (stream.match(keywords)) {
  976. return 'keyword'
  977. }
  978. if (stream.match(builtins)) {
  979. return 'builtin'
  980. }
  981. if (stream.match(identifiers)) {
  982. return 'variable'
  983. }
  984. if (stream.match(singleOperators) || stream.match(boolOperators)) {
  985. return 'operator'
  986. }
  987. // Handle non-detected items
  988. stream.next()
  989. return null
  990. }
  991. CodeMirror.defineMode('idl', function () {
  992. return {
  993. token: function (stream) {
  994. return tokenBase(stream)
  995. },
  996. }
  997. })
  998. CodeMirror.defineMIME('text/x-idl', 'idl')
  999. })