diff --git a/src/mol-script/transpile.ts b/src/mol-script/transpile.ts index c07f02fa5542ee842c9243a38156708dac6da010..7b94709a14b3ac32f99e838de772489ad1e335bd 100644 --- a/src/mol-script/transpile.ts +++ b/src/mol-script/transpile.ts @@ -1,7 +1,6 @@ - import Transpiler from './transpilers/transpiler' import _transpiler from './transpilers/all' -import compile from './runtime/query/compiler' +//import compile from './runtime/query/compiler' //import compile from './reference-implementation/molql/compiler' const transpiler: {[index: string]: Transpiler} = _transpiler @@ -9,21 +8,24 @@ const transpiler: {[index: string]: Transpiler} = _transpiler const util = require('util') 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') - compile(query) - } catch (e) { - console.log(str) - console.log(e.message) - console.log('\n') - } + 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 +const [,,lang, str] = process.argv; if (lang && str) { - parse(lang, str) + parse(lang, str); } + +default export parse; diff --git a/src/mol-script/transpilers/all.ts b/src/mol-script/transpilers/all.ts new file mode 100644 index 0000000000000000000000000000000000000000..78b47a9cf14f9339035225ae46756c623400ab50 --- /dev/null +++ b/src/mol-script/transpilers/all.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2017 MolQL contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +//import jmol from './jmol/parser' +//import json from './json/parser' +//import molQLscript from './molql-script/parser' +import pymol from './pymol/parser' +import vmd from './vmd/parser' + +export default { + pymol, + vmd +}