|
@@ -57,30 +57,30 @@ const valueOperators: OperatorList = [
|
|
|
type: h.binaryLeft,
|
|
|
rule: P.MonadicParser.alt(P.MonadicParser.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/, 1), P.MonadicParser.whitespace.result('=')),
|
|
|
map: (op, e1, e2) => {
|
|
|
-// console.log(e1.head !== undefined && e2.head !==undefined)
|
|
|
- console.log(op, e1, e2)
|
|
|
+ // console.log(e1.head !== undefined && e2.head !==undefined)
|
|
|
+ console.log(op, e1, e2);
|
|
|
let expr;
|
|
|
- if (e1.head !== undefined){
|
|
|
- if (e1.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') {
|
|
|
+ if (e1.head !== undefined) {
|
|
|
+ if (e1.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') {
|
|
|
expr = B.core.flags.hasAny([e1, sstrucMap(e2)]);
|
|
|
- }
|
|
|
- if (e1.head.name === 'core.type.regex') {
|
|
|
+ }
|
|
|
+ if (e1.head.name === 'core.type.regex') {
|
|
|
expr = B.core.str.match([e1, B.core.type.str([e2])]);
|
|
|
- }
|
|
|
- }else if (e2.head !== undefined){
|
|
|
- if (e2.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') {
|
|
|
+ }
|
|
|
+ } else if (e2.head !== undefined) {
|
|
|
+ if (e2.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') {
|
|
|
expr = B.core.flags.hasAny([e2, sstrucMap(e1)]);
|
|
|
- }
|
|
|
- if (e2.head.name === 'core.type.regex') {
|
|
|
+ }
|
|
|
+ if (e2.head.name === 'core.type.regex') {
|
|
|
expr = B.core.str.match([e2, B.core.type.str([e1])]);
|
|
|
- }
|
|
|
- }else if (op === '=~') {
|
|
|
+ }
|
|
|
+ } else if (op === '=~') {
|
|
|
if (e1.head) {
|
|
|
expr = B.core.str.match([
|
|
|
B.core.type.regex([`^${e2}$`, 'i']),
|
|
|
B.core.type.str([e1])
|
|
|
]);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
expr = B.core.str.match([
|
|
|
B.core.type.regex([`^${e1}$`, 'i']),
|
|
|
B.core.type.str([e2])
|