Skip to content

Commit

Permalink
add caller to CompilationOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalMarsalek committed Mar 31, 2024
1 parent f6610f3 commit 6b0278c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ if (options.all === true && options.output !== undefined) {
{
objective: options.chars === true ? "chars" : "bytes",
getAllVariants: options.all === true,
caller: "cli",
},
...langs,
)) {
Expand Down
2 changes: 2 additions & 0 deletions src/common/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface CompilationOptions {
codepointRange: [number, number];
skipPlugins: string[];
noEmit: boolean;
caller: "cli" | "playground" | "test" | undefined;
}

export function defaultCompilationOptions(
Expand All @@ -56,6 +57,7 @@ export function defaultCompilationOptions(
codepointRange: partial.codepointRange ?? [1, Infinity],
skipPlugins: partial.skipPlugins ?? [],
noEmit: partial.noEmit ?? false,
caller: undefined,
};
}

Expand Down
1 change: 1 addition & 0 deletions src/markdown-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function compilationOptionsFromKeywords(
skipTypecheck: isLangTest ? is("skipTypecheck") : !is("typecheck"),
skipPlugins: is("no:hardcode") ? ["hardcode"] : [],
noEmit: is("noEmit"),
caller: "test",
};
}

Expand Down

0 comments on commit 6b0278c

Please sign in to comment.