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

84.62% Statements 11/13
50% Branches 3/6
100% Functions 1/1
84.62% Lines 11/13

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 24 251x     1x 1x   1x     5x 5x 5x 5x     5x       5x 5x        
import * as Expressions from "../../2_statements/expressions";
import {ExpressionNode} from "../../nodes";
import {CurrentScope} from "../_current_scope";
import {Source} from "./source";
import {VoidType, TableType} from "../../types/basic";
 
export class SQLForAllEntries {
 
  public runSyntax(node: ExpressionNode, scope: CurrentScope, filename: string): void {
    const s = node.findFirstExpression(Expressions.Source);
    Eif (s) {
      const type = new Source().runSyntax(s, scope, filename);
      Iif (type instanceof VoidType) {
        return;
      }
      Iif (!(type instanceof TableType)) {
        throw new Error("FAE parameter must be table type");
      }
 
      const name = s.concatTokens();
      scope.setAllowHeaderUse(name);
    }
  }
 
}