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

84% Statements 21/25
33.33% Branches 1/3
100% Functions 1/1
84% Lines 21/25

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 1x 1x 1x 1x 1x 5x 5x 5x 5x     5x     5x 5x 5x 5x 5x 1x 1x
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);
    if (s) {
      const type = new Source().runSyntax(s, scope, filename);
      if (type instanceof VoidType) {
        return;
      }
      if (!(type instanceof TableType)) {
        throw new Error("FAE parameter must be table type");
      }
 
      const name = s.concatTokens();
      scope.setAllowHeaderUse(name);
    }
  }
 
}