All files / src/abap/5_syntax/statements form.ts

91.67% Statements 11/12
66.67% Branches 4/6
100% Functions 1/1
91.67% Lines 11/12

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    1x 1x 1x     1x   107x 107x     107x   107x 107x 107x 107x    
import {StatementNode} from "../../nodes";
import {CurrentScope} from "../_current_scope";
import {FormDefinition} from "../../types/form_definition";
import {ScopeType} from "../_scope_type";
import {FormName} from "../../2_statements/expressions";
import {StatementSyntax} from "../_statement_syntax";
 
export class Form implements StatementSyntax {
  public runSyntax(node: StatementNode, scope: CurrentScope, filename: string): void {
    const name = node.findDirectExpression(FormName)?.concatTokens();
    Iif (name === undefined) {
      throw new Error("Form, could not find name");
    }
    scope.push(ScopeType.Form, name, node.getFirstToken().getStart(), filename);
 
    const form = new FormDefinition(node, filename, scope);
    scope.addList(form.getUsingParameters());
    scope.addList(form.getChangingParameters());
    scope.addList(form.getTablesParameters());
  }
}