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

91.3% Statements 21/23
80% Branches 4/5
100% Functions 1/1
91.3% Lines 21/23

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 231x 1x 1x 1x 1x 1x 1x 1x 17x     17x 17x 13x 13x 17x 17x 19x 19x 16x 16x 16x 1x
import {ExpressionNode} from "../../nodes";
import {CurrentScope} from "../_current_scope";
import * as Expressions from "../../2_statements/expressions";
import {InlineFieldDefinition} from "./inline_field_definition";
import {ScopeType} from "../_scope_type";
 
export class Let {
  public runSyntax(node: ExpressionNode | undefined, scope: CurrentScope, filename: string, skipScope = false): boolean {
    if (node === undefined) {
      return false;
    }
 
    if (skipScope !== true) {
      scope.push(ScopeType.Let, "LET", node.getFirstToken().getStart(), filename);
    }
 
    for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {
      new InlineFieldDefinition().runSyntax(f, scope, filename);
    }
 
    return true;
  }
}