feat: move corpus to library
Test / test (push) Failing after 1m38s

This commit is contained in:
alexm committed 2026-10-06 10:27:46 -04:00
1 parent 5b8b079165
commit cae5cff55a
1350 files changed
+197 -941995

No files matched your search

+6 -6
View File
@@ -5,11 +5,11 @@ run time is emitted as .ts modules rather than imported JSON. Each file says
what generated it and from which commit; `npm test` checks they match the
pin and the corpus, so they cannot drift.
src/mojo/generated/pin.ts the version and godbolt compiler, from mojo/pin.json
src/mojo/generated/pin.ts the version and godbolt compiler, from library/mojo/pin.json
src/mojo/generated/tokens.ts the words of the language, from corpus/tokens/tokens.json
src/mojo/generated/editor.ts comment and indentation rules, from corpus/editor/editor.json
src/mojo/generated/programs.ts our own programs (mojo/local/), each with its verdict from the goldens
syntax/mojo.xml the same words, as a KDE syntax for Pandoc listings (kde.py); pplus-web copies it into its Quarto extension
src/mojo/generated/programs.ts our own programs (library/mojo/local/), each with its verdict from the goldens
library/syntax/mojo.xml the same words, as a KDE syntax for Pandoc listings (kde.py); pplus-web copies it into its Quarto extension
"""
from __future__ import annotations
@@ -20,9 +20,9 @@ from pathlib import Path
from .common import CORPUS, GENERATED_TS, REPO, Pin, PipelineError, load_lock, read_json, write_text
from .kde import mojo_xml
SYNTAX_DIR = REPO / "syntax" # pplus-web copies it into its Quarto extension (its quarto-css task)
SYNTAX_DIR = REPO / "library" / "syntax" # in pplus-library; pplus-web copies it into its Quarto extension (its quarto-css task)
BANNER = "// Generated by scripts/mojo/corpus.py emit. Do not edit; change mojo/pin.json or re-harvest.\n"
BANNER = "// Generated by scripts/mojo/corpus.py emit. Do not edit; change library/mojo/pin.json or re-harvest.\n"
def ts(value) -> str:
@@ -132,7 +132,7 @@ def emit(pin: Pin, out_dir: Path = GENERATED_TS, corpus: Path = CORPUS, syntax_d
}
programs_ts = (
BANNER
+ "// Our own Mojo programs (mojo/local/), each checked on the pinned compiler by `corpus.py verify`.\n"
+ "// Our own Mojo programs (library/mojo/local/), each checked on the pinned compiler by `corpus.py verify`.\n"
+ "// `verified` is true only when godbolt's answer passed the program's own expectation.\n\n"
+ "export interface MojoProgram { source: string; verdict: string; verified: boolean; why: string }\n\n"
+ f"export const MOJO_PROGRAMS: Readonly<Record<string, MojoProgram>> = {ts(programs)};\n"