added querying by children

This commit is contained in:
zadam
2020-05-23 10:36:49 +02:00
parent 4ea934509e
commit 3d12341ff1
3 changed files with 112 additions and 88 deletions

View File

@@ -4,6 +4,7 @@ const AndExp = require('./expressions/and');
const OrExp = require('./expressions/or');
const NotExp = require('./expressions/not');
const ChildOfExp = require('./expressions/child_of');
const ParentOfExp = require('./expressions/parent_of');
const PropertyComparisonExp = require('./expressions/property_comparison');
const AttributeExistsExp = require('./expressions/attribute_exists');
const LabelComparisonExp = require('./expressions/label_comparison');
@@ -56,6 +57,12 @@ function getExpression(tokens, parsingContext) {
return new ChildOfExp(parseNoteProperty());
}
if (tokens[i] === 'child') {
i += 1;
return new ParentOfExp(parseNoteProperty());
}
if (tokens[i] === 'title') {
const propertyName = tokens[i];
const operator = tokens[i + 1];