All files / src/abap/5_syntax/expressions cond.ts

91.67% Statements 22/24
80% Branches 4/5
100% Functions 1/1
91.67% Lines 22/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x 1x 1x 1x 1x 1x 1x 32x     32x 32x 1x 1x 1x 1x 1x 32x 32x 31x 31x 22x 22x 1x
import * as Expressions from "../../2_statements/expressions";
import {ExpressionNode} from "../../nodes";
import {CurrentScope} from "../_current_scope";
import {Compare} from "./compare";
 
export class Cond {
  public runSyntax(node: ExpressionNode | undefined, scope: CurrentScope, filename: string): void {
    if (node === undefined) {
      throw new Error("Cond, expected node input");
    }
 
    for (const t of node.findDirectExpressions(Expressions.CondSub)) {
      const c = t.findDirectExpression(Expressions.Cond);
      if (c) {
        new Cond().runSyntax(c, scope, filename);
      }
    }
 
    for (const t of node.findDirectExpressions(Expressions.Compare)) {
      new Compare().runSyntax(t, scope, filename);
    }
 
  }
}