message: Added pymol, jmol and vmd alongside mol-script: pymol is now enabled
diff: * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
  +import { transpileMolScript } from './script/mol-script/symbols';
  +import { parseMolScript } from './language/parser';
  import { parse } from './transpile';
  import { Expression } from './language/expression';
  import { StructureElement, QueryContext, StructureSelection, Structure, QueryFn, QueryContextOptions } from '../mol-model/structure';
  @@ -19,7 +21,7 @@ function Script(expression: string, language: Script.Language): Script {
  }
  namespace Script {
  - export type Language = 'pymol'
  + export type Language = 'mol-script' | 'pymol' | 'vmd' | 'jmol'
  export function is(x: any): x is Script {
  return !!x && typeof (x as Script).expression === 'string' && !!(x as Script).language;
  @@ -31,10 +33,18 @@ namespace Script {
  export function toExpression(script: Script): Expression {
  switch (script.language) {
  + case 'mol-script':
  + const parsed = parseMolScript(script.expression);
  + if (parsed.length === 0) throw new Error('No query');
  + return transpileMolScript(parsed[0]);
  case 'pymol':
  - const parsed = parse("pymol",script.expression);
  - return parsed as Expression;
  + return parse("pymol",script.expression) as Expression;
  + case 'jmol':
  + return parse("jmol",script.expression) as Expression;
  + case 'vmd':
  + return parse("vmd",script.expression) as Expression;
  }
  +
  throw new Error('unsupported script language');
  }
  