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

cleaning by lint

parent 10cf0db0
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ export function prefix(opParser: P.MonadicParser<any>, nextParser: P.MonadicPars
export function prefixRemoveKet(opParser: P.MonadicParser<any>, nextParser: P.MonadicParser<any>, mapFn: any) {
const parser: P.MonadicParser<any> = P.MonadicParser.lazy(() => {
return P.MonadicParser.seq(opParser, parser.skip(P.MonadicParser.string(")")))
return P.MonadicParser.seq(opParser, parser.skip(P.MonadicParser.string(')')))
.map(x => mapFn(...x))
.or(nextParser);
});
......
......@@ -14,7 +14,7 @@ import { MolScriptBuilder } from '../../../mol-script/language/builder';
const B = MolScriptBuilder;
import { OperatorList } from '../types';
import { Expression } from '../../language/expression';
import { macroproperties } from './macroproperties'
import { macroproperties } from './macroproperties';
const propNames = Object.keys(macroproperties).sort(h.strLenSortFn)
.filter(name => !macroproperties[name].isUnsupported).join('|');
......@@ -34,8 +34,8 @@ export const operators: OperatorList = [
'@examples': ['ASP and .CA'],
name: 'and',
type: h.binaryLeft,
rule: P.MonadicParser.alt(h.infixOp(/AND|&/i), P.MonadicParser.whitespace),
//rule: h.infixOp(/AND|&/i),
rule: P.MonadicParser.alt(h.infixOp(/AND|&/i), P.MonadicParser.whitespace),
// rule: h.infixOp(/AND|&/i),
map: (op, selection, by) => B.struct.modifier.intersectBy({ 0: selection, by })
},
{
......@@ -56,21 +56,22 @@ export const operators: OperatorList = [
console.log(x)
return parseFloat(x)}),
map: (radius: number, selection: Expression) => {
return B.struct.modifier.includeSurroundings({ 0: selection, radius });
}
},
*/
{
'@desc':'Selects atoms in s1 that are within X Angstroms of any atom in s2.',
'@desc': 'Selects atoms in s1 that are within X Angstroms of any atom in s2.',
'@examples': ['chain A WITHIN 3 OF chain B'],
name: 'within',
abbr: ['w2.'],
// type: h.binaryLeft,
type: h.prefixRemoveKet,
// type: h.binaryLeft,
type: h.prefixRemoveKet,
rule: h.prefixOpNoWhiteSpace(/within\s*\(\s*([-+]?[0-9]*\.?[0-9]+)\s*,/i, 1).map((x: any) => {
console.log(x)
return parseFloat(x)}),
console.log(x);
return parseFloat(x);
}),
map: (radius: number, target: Expression) => {
return B.struct.filter.within({
0: B.struct.generator.all(),
......
......@@ -13,8 +13,8 @@ import { MolScriptBuilder } from '../../../mol-script/language/builder';
const B = MolScriptBuilder;
import { properties } from './properties';
import { macroproperties } from './macroproperties';
//import { macrokeywords } from './macrokeywords';
//import { macrooperators } from './macrooperators';
// import { macrokeywords } from './macrokeywords';
// import { macrooperators } from './macrooperators';
import { operators } from './operators';
import { keywords } from './keywords';
import { AtomGroupArgs } from '../types';
......@@ -65,12 +65,12 @@ function atomSelectionQuery2(x: any) {
return B.struct.generator.atomGroups(tests);
}
//function atomExpressionQuery(x: any[]) {
// function atomExpressionQuery(x: any[]) {
// const resname = x[0];
// if (resname){
// return B.struct.generator.atomGroups({'residue-test': B.core.rel.eq([B.ammp('label_comp_id'), resname])})
// }
//}
// }
// }
const lang = P.MonadicParser.createLanguage({
......@@ -88,15 +88,15 @@ const lang = P.MonadicParser.createLanguage({
r.Keywords,
r.NamedAtomProperties,
r.AtomSelectionMacro.map(atomSelectionQuery2),
// r.AtomExparession.map(atomExpressionQuery),
// r.AtomExparession.map(atomExpressionQuery),
r.Object,
r.Object2,
r.Object2,
);
},
// AtomExpression: function (r: any) {
// return P.MonadicParser.seq(r.Resname.or(P.MonadicParser.of(null)));
// },
// AtomExpression: function (r: any) {
// return P.MonadicParser.seq(r.Resname.or(P.MonadicParser.of(null)));
// },
......@@ -150,38 +150,38 @@ const lang = P.MonadicParser.createLanguage({
// lys:a.ca lys:a lys lys.ca
// [lys]:a.ca [lys]:a [lys] [lys].ca
commu.then(P.MonadicParser.alt(
P.MonadicParser.alt(
P.MonadicParser.alt(
P.MonadicParser.alt(
P.MonadicParser.seq(
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator).skip(colon),
orNull(propertiesDict.chain).skip(dot),
orNull(propertiesDict.name)
).map(x => { return { resn: x[0], chain: x[1], name: x[2] }; }),
P.MonadicParser.seq(
).map(x => { return { resn: x[0], chain: x[1], name: x[2] }; }),
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator).skip(star),
orNull(propertiesDict.chain).skip(dot),
orNull(propertiesDict.name)
).map(x => { return { resn: x[0], chain: x[1], name: x[2] }; }),
P.MonadicParser.seq(
).map(x => { return { resn: x[0], chain: x[1], name: x[2] }; }),
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator).skip(colon),
orNull(propertiesDict.chain),
).map(x => { return { resn: x[0], chain: x[1] }; }),
P.MonadicParser.seq(
).map(x => { return { resn: x[0], chain: x[1] }; }),
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator).skip(star),
orNull(propertiesDict.chain),
).map(x => { return { resn: x[0], chain: x[1] }; }),
P.MonadicParser.seq(
).map(x => { return { resn: x[0], chain: x[1] }; }),
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator).skip(dot),
orNull(propertiesDict.name),
).map(x => { return { resn: x[0], name: x[1] }; }),
P.MonadicParser.seq(
).map(x => { return { resn: x[0], name: x[1] }; }),
P.MonadicParser.seq(
orNull(propertiesDict.resn).skip(tator),
).map(x => { return { resn: x[0] }; })
).map(x => { return { resn: x[0] }; })
)
)
)
)
)
);
},
ObjectProperty: () => {
......@@ -208,10 +208,10 @@ const lang = P.MonadicParser.createLanguage({
},
// Resname: () => P.MonadicParser.regexp(s/[a-zA-Z0-9]{1,4}/).desc('resname'),
// Resname: () => P.MonadicParser.regexp(/\[[A-Z0-9]{1,4}\]/).desc('resname'),
// Resname: () => P.MonadicParser.regexp(s/[a-zA-Z0-9]{1,4}/).desc('resname'),
// Resname: () => P.MonadicParser.regexp(/\[[A-Z0-9]{1,4}\]/).desc('resname'),
NamedAtomProperties: function () {
return P.MonadicParser.alt(...h.getNamedPropertyRules(properties));
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment