Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def add_zero(x):
- Paper: [BendRT: A Parallel Runtime for CPUs and GPUs](paper/BendRT.pdf).
- Formalization: [bendtt.lean](bend2/bendtt.lean), the kernel of `--verdict` and its proofs, in Lean.
- Benches: [bench/](bench), every bench used to make the charts above.
- Module smoke checks: `bend aggregation.bend --checkup` checks and runs
each aliased import independently, including lines with trailing `#` comments.
- Formatter: [bend-fmt-lsp](tools/bend-fmt-lsp), a formatting-only Bend 2 language server.
- Community language server: [bend2-lsp](https://github.com/don2e4/bend2-lsp), with formatting, diagnostics, and hover.
- Community workshop: [Bend 2 pocket workshop](https://np.github.io/bend-workshop/), the checker and JS compiler in one HTML page, with goals and proof tools, phone first.
Expand Down
2 changes: 1 addition & 1 deletion bend2/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async function cli_checkup(file: string): Promise<void> {
const base = await book_read(BASE);
let bad = false;
for (const raw of fs.readFileSync(file, "utf8").split("\n")) {
const m = /^import\s+(\S+)\s+as\s+[A-Za-z_][A-Za-z0-9_]*\s*$/
const m = /^import\s+(\S+)\s+as\s+[A-Za-z_][A-Za-z0-9_]*\s*(?:#.*)?$/
.exec(raw.trim());
if (m === null) {
continue;
Expand Down
7 changes: 7 additions & 0 deletions gates/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ try {
const got = await bend_closed(args);
check("a closed reader keeps success: " + args.join(" "), got.code === 0);
}
fs.writeFileSync(checkup, "import ./bad.bend as Bad # must still fail\n");
fs.writeFileSync(good_checkup, "import ./sum.bend as Good # must still run\n");
const comment_bad = await bend([checkup, "--checkup"]);
const comment_good = await bend([good_checkup, "--checkup"]);
check("import comments preserve checkup rejection and execution",
comment_bad.code === 1 && comment_good.code === 0
&& comment_good.out.endsWith("5n\n"));
const two = "import Base\ndef two() -> Nat:\n 2n\n";
const use = (at: string) => "import Base\nimport ./" + at
+ " as T\ndef main() -> Nat:\n T.two\n";
Expand Down