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

82.6% Statements 19/23
33.33% Branches 1/3
100% Functions 1/1
82.6% Lines 19/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 1x 200x 200x         200x 200x 200x 200x 200x 200x 200x 1x
import {StatementNode} from "../../nodes";
import {FormDefinition} from "../../types/form_definition";
import {ScopeType} from "../_scope_type";
import {FormName} from "../../2_statements/expressions";
import {StatementSyntax} from "../_statement_syntax";
import {SyntaxInput, syntaxIssue} from "../_syntax_input";
 
export class Form implements StatementSyntax {
  public runSyntax(node: StatementNode, input: SyntaxInput): void {
    const name = node.findDirectExpression(FormName)?.concatTokens();
    if (name === undefined) {
      const message = "Form, could not find name";
      input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
      return;
    }
    input.scope.push(ScopeType.Form, name, node.getFirstToken().getStart(), input.filename);
 
    const form = new FormDefinition(node, input);
    input.scope.addList(form.getUsingParameters());
    input.scope.addList(form.getChangingParameters());
    input.scope.addList(form.getTablesParameters());
  }
}