Skip to content
Snippets Groups Projects
Commit 577daf64 authored by yakomaxa's avatar yakomaxa
Browse files

PyMOL mode was successfully enabled (though mol-script is disabled...)

parent 0b1943e9
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,6 @@
* @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';
......@@ -33,15 +31,8 @@ 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);
// if (parsed.length === 0) throw new Error('No query');
//return transpileMolScript(parsed);
return parsed as Expression;
}
throw new Error('unsupported script language');
......
import Transpiler from './transpilers/transpiler'
import _transpiler from './transpilers/all'
//import compile from './runtime/query/compiler'
//import compile from './reference-implementation/molql/compiler'
const transpiler: {[index: string]: Transpiler} = _transpiler
//const util = require('util')
export function parse(lang: string, str: string) {
try {
const query = transpiler[lang](str);
// console.log(str);
//console.log(util.inspect(query, {depth: 20, color: true}));
// console.log('\n');
return query;
//compile(query)
} catch (e) {
// console.log(str);
// console.log(e.message);
// console.log('\n');
}
}
//const [,,lang, str] = process.argv;
//if (lang && str) {
// parse(lang, str);
//}
//export default parse;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment