Skip to content

Commit

Permalink
no func
Browse files Browse the repository at this point in the history
  • Loading branch information
verytactical committed Feb 4, 2025
1 parent 8598182 commit 6e41992
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ast/ast-printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { groupBy, intercalate, isUndefined } from "../utils/array";
import { makeVisitor } from "../utils/tricks";
import { astNumToString, idText } from "./ast-helpers";
import { asString } from "../imports/path";
import { throwInternalCompilerError } from "../error/errors";

//
// Types
Expand Down Expand Up @@ -646,11 +647,16 @@ export const ppContractBody: Printer<A.AstContractDeclaration> =
});

export const ppAstImport: Printer<A.AstImport> =
({ importPath: { path, type } }) =>
({ importPath: { path, type, language } }) =>
(c) => {
if (type === "relative") {
return c.row(`import "${asString(path)}";`);
} else {
if (language === "func") {
throwInternalCompilerError(
"There are no standard library files in FunC",
);
}
const displayPath = asString(path).slice(0, -".tact".length);
return c.row(`import "@stdlib/${displayPath}";`);
}
Expand Down

0 comments on commit 6e41992

Please sign in to comment.