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

94.12% Statements 16/17
50% Branches 2/4
100% Functions 1/1
94.12% Lines 16/17

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 25 26 27 28 29 30 31 321x   1x   1x 1x   1x     3x 3x 5x 5x     3x     3x   3x 3x 3x     3x 5x        
import * as Expressions from "../../2_statements/expressions";
import {ExpressionNode} from "../../nodes";
import {IStructureComponent, StructureType, VoidType} from "../../types/basic";
import {CurrentScope} from "../_current_scope";
import {ComponentCompare} from "./component_compare";
import {InlineFS} from "./inline_fs";
 
export class LoopGroupBy {
  public runSyntax(node: ExpressionNode, scope: CurrentScope, filename: string): void {
 
    const components: IStructureComponent[] = [];
    for (const c of node.findDirectExpressions(Expressions.ComponentCompare)) {
      for (const f of c.findDirectExpressions(Expressions.ComponentChainSimple)) {
        components.push({name: f.getFirstToken().getStr(), type: new VoidType("todoGroupBy")});
      }
    }
    Iif (components.length === 0) {
      return;
    }
    const sourceType = new StructureType(components);
 
    const inlinefs = node.findFirstExpression(Expressions.InlineFS);
    Eif (inlinefs) {
      new InlineFS().runSyntax(inlinefs, scope, filename, sourceType);
    }
 
    for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
      new ComponentCompare().runSyntax(t, scope, filename);
    }
 
  }
}