rename crate to pkg

This commit is contained in:
nora 2023-12-15 18:35:20 +01:00
parent 7ca78530a1
commit b273b20a75
11 changed files with 124 additions and 124 deletions

View file

@ -1,7 +1,7 @@
import {
BuiltinName,
COMPARISON_KINDS,
Crate,
Pkg,
EQUALITY_KINDS,
Expr,
ExprBinary,
@ -119,7 +119,7 @@ export function typeOfBuiltinValue(
export function checkBody(
cx: TypeckCtx,
ast: Crate<Resolved>,
ast: Pkg<Resolved>,
body: Expr<Resolved>,
fnTy: TyFn,
): Expr<Typecked> {

View file

@ -1,5 +1,5 @@
import {
Crate,
Pkg,
Expr,
Folder,
Item,
@ -23,8 +23,8 @@ import { emitError, typeOfItem } from "./item";
export function typeck(
gcx: GlobalContext,
ast: Crate<Resolved>,
): Crate<Typecked> {
ast: Pkg<Resolved>,
): Pkg<Typecked> {
const cx = {
gcx,
itemTys: new ComplexMap<ItemId, Ty | null>(),
@ -203,7 +203,7 @@ export function typeck(
});
if (ast.id === 0) {
// Only the final id=0 crate needs and cares about main.
// Only the final id=0 pkg needs and cares about main.
if (!main) {
emitError(
cx,

View file

@ -1,5 +1,5 @@
import {
Crate,
Pkg,
ItemId,
Resolved,
Ty,
@ -26,7 +26,7 @@ export type TypeckCtx = {
* afterwards, we get the ty.
*/
itemTys: ComplexMap<ItemId, Ty | null>;
ast: Crate<Resolved>;
ast: Pkg<Resolved>;
};
export function mkTyFn(params: Ty[], returnTy: Ty): Ty {
@ -160,8 +160,8 @@ export function typeOfItem(
genericArgs: Ty[],
cause: Span,
): Ty {
if (itemId.crateId !== cx.ast.id) {
// Look up foreign items in the foreign crates, we don't need to lower those
if (itemId.pkgId !== cx.ast.id) {
// Look up foreign items in the foreign pkgs, we don't need to lower those
// ourselves.
const item = cx.gcx.findItem(itemId);