All files / src/abap/5_syntax _reserved_names.ts

100% Statements 10/10
100% Branches 4/4
100% Functions 1/1
100% Lines 10/10

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 111x 1x 1x 1x 71868x 71868x 71865x 71865x 3x 3x  
import {AbstractToken} from "../1_lexer/tokens/abstract_token";
import {SyntaxInput, syntaxIssue} from "./_syntax_input";
 
/** "me" is the self reference in classes, it cannot be declared as a parameter, attribute or variable */
export function checkReservedName(token: AbstractToken | undefined, input: SyntaxInput): void {
  if (token === undefined || token.getStr().toLowerCase() !== "me" || input.scope.isAnyOO() === false) {
    return;
  }
  input.issues.push(syntaxIssue(input, token, "\"me\" is a reserved name, it cannot be declared"));
}