Skip to content
Snippets Groups Projects
Select Git revision
  • 1e6e956e2d6cc66ac1d71f3f607c5817dff76604
  • master default protected
  • rednatco-v2
  • base-pairs-ladder
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

transpile.ts

  • transpile.ts 684 B
    /**
     * Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
     *
     * @author Koya Sakuma <koya.sakuma.work@gmail.com>
     *
     * Adapted from MolQL src/transpile.ts
     */
    
    import { Transpiler } from './transpilers/transpiler';
    import { _transpiler } from './transpilers/all';
    import { Expression } from './language/expression';
    import { Script } from './script';
    const transpiler: {[index: string]: Transpiler} = _transpiler;
    
    export function parse(lang: Script.Language, str: string): Expression {
        try {
    
            const query = transpiler[lang](str);
            return query;
    
        } catch (e) {
    
            console.error(e.message);
            throw e;
    
        }
    }