Browse Source

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

yakomaxa 2 năm trước cách đây
mục cha
commit
577daf64df
2 tập tin đã thay đổi với 1 bổ sung30 xóa
  1. 0 9
      src/mol-script/script.ts
  2. 1 21
      src/mol-script/transpile.ts

+ 0 - 9
src/mol-script/script.ts

@@ -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');

+ 1 - 21
src/mol-script/transpile.ts

@@ -1,32 +1,12 @@
 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;
-