Skip to content
Snippets Groups Projects
Select Git revision
  • 697a22dda249daef5f1019ed1a4e3cf3967c7bf0
  • master default protected
  • devel
  • hruska-feature-clients-api
  • malostik-#5066-deduplicate-idea-ids
  • warden-postgresql-port
  • hruska-feature-#6799-filter-keys
  • hruska-feature-5066-duplicateIdeaID
  • warden-client-3.0-beta3
  • warden-server-3.0-beta3
  • warden-client-2.2-final
  • warden-server-2.2-final
  • warden-client-3.0-beta2
  • warden-server-3.0-beta2
  • warden-client-2.2
  • warden-server-2.2-patch3
  • warden-client-3.0-beta1
  • warden-server-3.0-beta1
  • warden-server-2.2-patch1
  • warden-client-3.0-beta0
  • warden-server-3.0-beta0
  • warden-server-2.2
  • warden-server-2.1-patch1
  • warden-client-2.1
  • warden-server-2.1
  • warden-server-2.1-beta6
  • warden-server-2.1-beta5
  • warden-server-2.1-beta4
28 results

ApacheDispatch.pm

Blame
  • operators.ts 1.41 KiB
    /*
     * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
     * @author Koya Sakuma <koya.sakuma.work@gmail.com>
     * Adapted from MolQL project
     */
    
    
    import * as P from '../../../mol-util/monadic-parser';
    import * as h from '../helper';
    import { MolScriptBuilder } from '../../../mol-script/language/builder';
    const B = MolScriptBuilder;
    import { OperatorList } from '../types';
    // import { Expression } from '../../language/expression';
    
    
    export const operators: OperatorList = [
        {
            '@desc': 'Selects atoms that are not included in s1.',
            '@examples': ['not ARG'],
            name: 'not',
            type: h.prefix,
            rule: P.MonadicParser.alt(P.MonadicParser.regex(/NOT/i).skip(P.MonadicParser.whitespace), P.MonadicParser.string('!').skip(P.MonadicParser.optWhitespace)),
            map: (op, selection) => h.invertExpr(selection),
        },
        {
            '@desc': 'Selects atoms included in both s1 and s2.',
            '@examples': ['ASP and .CA'],
            name: 'and',
            type: h.binaryLeft,
            rule: h.infixOp(/AND|&/i),
            map: (op, selection, by) => B.struct.modifier.intersectBy({ 0: selection, by })
        },
        {
            '@desc': 'Selects atoms included in either s1 or s2.',
            '@examples': ['ASP or GLU'],
            name: 'or',
            type: h.binaryLeft,
            rule: h.infixOp(/OR|\|/i),
            map: (op, s1, s2) => B.struct.combinator.merge([s1, s2])
        }
    ];