(index, stepType, stepValueId, captureNames, stringValues, steps, textPredicates, predicates, setProperties, assertedProperties, refutedProperties)
| 3523 | } |
| 3524 | __name(parseSetDirective, "parseSetDirective"); |
| 3525 | function parsePattern(index, stepType, stepValueId, captureNames, stringValues, steps, textPredicates, predicates, setProperties, assertedProperties, refutedProperties) { |
| 3526 | if (stepType === PREDICATE_STEP_TYPE_CAPTURE) { |
| 3527 | const name2 = captureNames[stepValueId]; |
| 3528 | steps.push({ type: "capture", name: name2 }); |
| 3529 | } else if (stepType === PREDICATE_STEP_TYPE_STRING) { |
| 3530 | steps.push({ type: "string", value: stringValues[stepValueId] }); |
| 3531 | } else if (steps.length > 0) { |
| 3532 | if (steps[0].type !== "string") { |
| 3533 | throw new Error("Predicates must begin with a literal value"); |
| 3534 | } |
| 3535 | const operator = steps[0].value; |
| 3536 | switch (operator) { |
| 3537 | case "any-not-eq?": |
| 3538 | case "not-eq?": |
| 3539 | case "any-eq?": |
| 3540 | case "eq?": |
| 3541 | parseAnyPredicate(steps, index, operator, textPredicates); |
| 3542 | break; |
| 3543 | case "any-not-match?": |
| 3544 | case "not-match?": |
| 3545 | case "any-match?": |
| 3546 | case "match?": |
| 3547 | parseMatchPredicate(steps, index, operator, textPredicates); |
| 3548 | break; |
| 3549 | case "not-any-of?": |
| 3550 | case "any-of?": |
| 3551 | parseAnyOfPredicate(steps, index, operator, textPredicates); |
| 3552 | break; |
| 3553 | case "is?": |
| 3554 | case "is-not?": |
| 3555 | parseIsPredicate(steps, index, operator, assertedProperties, refutedProperties); |
| 3556 | break; |
| 3557 | case "set!": |
| 3558 | parseSetDirective(steps, index, setProperties); |
| 3559 | break; |
| 3560 | default: |
| 3561 | predicates[index].push({ operator, operands: steps.slice(1) }); |
| 3562 | } |
| 3563 | steps.length = 0; |
| 3564 | } |
| 3565 | } |
| 3566 | __name(parsePattern, "parsePattern"); |
| 3567 | var Query = class { |
| 3568 | static { |
no test coverage detected