move ribs out
This commit is contained in:
parent
493a11a93b
commit
188c2d806d
@ -91,35 +91,3 @@ export class AstLowerer {
|
||||
return todo();
|
||||
}
|
||||
}
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/struct.Rib.html
|
||||
type Rib = {
|
||||
kind: RibKind;
|
||||
bindings: Map<IdentId, Res>;
|
||||
};
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/enum.RibKind.html
|
||||
type RibKind =
|
||||
| { tag: "normal" }
|
||||
| { tag: "fn" }
|
||||
| { tag: "item"; defKind: DefKind }
|
||||
| { tag: "mod" };
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/enum.RibKind.html
|
||||
type Res =
|
||||
| { tag: "error" }
|
||||
| { tag: "def"; kind: DefKind; id: DefId }
|
||||
| { tag: "local"; id: DefId };
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def/enum.DefKind.html
|
||||
type DefKind =
|
||||
| { type: "mod" }
|
||||
| { type: "struct" }
|
||||
| { type: "enum" }
|
||||
| { type: "variant" }
|
||||
| { type: "ty_alias" }
|
||||
| { type: "ty_param" }
|
||||
| { type: "fn" }
|
||||
| { type: "ctor" }
|
||||
| { type: "use" }
|
||||
| { type: "field" };
|
||||
|
33
compiler/middle/rib.ts
Normal file
33
compiler/middle/rib.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { DefId, IdentId } from "../ctx.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 =
|
||||
| { tag: "normal" }
|
||||
| { tag: "fn" }
|
||||
| { tag: "item"; defKind: DefKind }
|
||||
| { tag: "mod" };
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/enum.RibKind.html
|
||||
export type Res =
|
||||
| { tag: "error" }
|
||||
| { tag: "def"; kind: DefKind; id: DefId }
|
||||
| { tag: "local"; id: DefId };
|
||||
|
||||
// https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def/enum.DefKind.html
|
||||
export type DefKind =
|
||||
| { type: "mod" }
|
||||
| { type: "struct" }
|
||||
| { type: "enum" }
|
||||
| { type: "variant" }
|
||||
| { type: "ty_alias" }
|
||||
| { type: "ty_param" }
|
||||
| { type: "fn" }
|
||||
| { type: "ctor" }
|
||||
| { type: "use" }
|
||||
| { type: "field" };
|
Loading…
Reference in New Issue
Block a user