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

90.91% Statements 10/11
50% Branches 2/4
100% Functions 1/1
90.91% Lines 10/11

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   23x       23x 1x 1x 1x       23x 22x        
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 {
    Iif (node === undefined) {
      throw new Error("Cond, expected node input");
    }
 
    for (const t of node.findDirectExpressions(Expressions.CondSub)) {
      const c = t.findDirectExpression(Expressions.Cond);
      Eif (c) {
        new Cond().runSyntax(c, scope, filename);
      }
    }
 
    for (const t of node.findDirectExpressions(Expressions.Compare)) {
      new Compare().runSyntax(t, scope, filename);
    }
 
  }
}