22 lines
782 B
TypeScript
22 lines
782 B
TypeScript
import { IdentId } from "../ctx.ts";
|
|
import { DefKind, Mod, Res } from "./res.ts";
|
|
|
|
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/struct.Rib.html
|
|
export type Rib = {
|
|
kind: RibKind;
|
|
bindings: Map<IdentId, Res>;
|
|
};
|
|
|
|
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/enum.RibKind.html
|
|
export type RibKind =
|
|
/// No restriction needs to be applied.
|
|
| { tag: "normal" }
|
|
/// We passed through a function, closure or coroutine signature. Disallow labels.
|
|
| { tag: "fn" }
|
|
/// We passed through an item scope. Disallow upvars.
|
|
| { tag: "item"; defKind: DefKind }
|
|
/// We passed through a module.
|
|
| { tag: "mod"; mod: Mod }
|
|
/// We passed through a block (same as module, see Rust).
|
|
| { tag: "block" };
|