symbols.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  4. * @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
  5. *
  6. * @author Koya Sakuma
  7. * This module is based on jmol tranpiler from MolQL and modified in similar manner as pymol and vmd tranpilers. \
  8. */
  9. import { properties } from './properties';
  10. import { macroproperties } from './macroproperties';
  11. import { operators } from './operators';
  12. import { keywords } from './keywords';
  13. export const Properties: string[] = [];
  14. for (const name in properties) {
  15. if (properties[name].isUnsupported) continue;
  16. Properties.push(name);
  17. if (properties[name].abbr) Properties.push(...properties[name].abbr!);
  18. }
  19. for (const name in macroproperties) {
  20. if (macroproperties[name].isUnsupported) continue;
  21. Properties.push(name);
  22. if (macroproperties[name].abbr) Properties.push(...macroproperties[name].abbr!);
  23. }
  24. export const Operators: string[] = [];
  25. operators.forEach(o => {
  26. if (o.isUnsupported) return;
  27. Operators.push(o.name);
  28. if (o.abbr) Operators.push(...o.abbr);
  29. });
  30. export const Keywords: string[] = [];
  31. for (const name in keywords) {
  32. if (!keywords[name].map) continue;
  33. Keywords.push(name);
  34. if (keywords[name].abbr) Keywords.push(...keywords[name].abbr!);
  35. }
  36. export const _all = { Properties, Operators, Keywords };