All files / transpiler/logic/analysis/types IScopeFrame.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

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                                                         
/**
 * Declarations directly in one lexical scope (a function, named scope, block, or
 * for-loop header), with a link to the enclosing scope. Resolution searches
 * outward to the global frame, so inner declarations shadow outer ones.
 *
 * `vars` maps a declared name to its declared type text, so a consumer can map
 * the name to whatever notion of type it needs -- essential category for MISRA
 * Rule 10.4, essentially-Boolean for Rule 10.1 -- without each analyzer building
 * its own index of declarations.
 */
import type IScopeSymbol from "../../../types/symbols/IScopeSymbol";
 
interface IScopeFrame {
  readonly vars: Map<string, string>;
  readonly parent: IScopeFrame | null;
  /**
   * The `scope` this frame belongs to, or null outside one. Carried so a
   * `this.member()` call can be keyed by its transpiled C name, which is
   * qualified by the scope (Issue #1183 review).
   *
   * #1357: the scope REFERENCE, not its leaf name. Qualifying from the leaf
   * dropped every outer scope, so a frame inside `Outer.Inner` keyed
   * `this.member()` as `Inner__member`.
   */
  readonly scope: IScopeSymbol | null;
}
 
export default IScopeFrame;