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

Compiles but not working again

parent 364baab1
Branches
Tags
No related merge requests found
import Transpiler from './transpilers/transpiler' import Transpiler from './transpilers/transpiler'
import _transpiler from './transpilers/all' import _transpiler from './transpilers/all'
import compile from './runtime/query/compiler' //import compile from './runtime/query/compiler'
//import compile from './reference-implementation/molql/compiler' //import compile from './reference-implementation/molql/compiler'
const transpiler: {[index: string]: Transpiler} = _transpiler const transpiler: {[index: string]: Transpiler} = _transpiler
...@@ -10,20 +9,23 @@ const util = require('util') ...@@ -10,20 +9,23 @@ const util = require('util')
function parse(lang: string, str: string) { function parse(lang: string, str: string) {
try { try {
const query = transpiler[lang](str) const query = transpiler[lang](str);
console.log(str) console.log(str);
console.log(util.inspect(query, {depth: 20, color: true})) console.log(util.inspect(query, {depth: 20, color: true}));
console.log('\n') console.log('\n');
compile(query) return query;
//compile(query)
} catch (e) { } catch (e) {
console.log(str) console.log(str);
console.log(e.message) console.log(e.message);
console.log('\n') console.log('\n');
} }
} }
const [,,lang, str] = process.argv const [,,lang, str] = process.argv;
if (lang && str) { if (lang && str) {
parse(lang, str) parse(lang, str);
} }
default export parse;
/*
* 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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment