From ce920b6ff47f32bc06dd27124e1b882f82f3d6ae Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 10:05:40 +0000 Subject: split compiler.zc into files by phase src/compiler/compiler.zc is now twelve files under src/compiler/, listed in order in src/compiler/parts. cat of the parts in order is byte-identical to the old file, so every compiler and image except the language server's is unchanged. no function was edited. consumers read the list: the makefile, bootstrap-check, genmap (which still writes one compiler.zc into a generated map directory), tinyvm.bat, test.sh, test_win.ps1 and the lsp drivers. the language server embeds each part and serves them joined as the one document tinyvm:/compiler.zc. --- src/tools/zc0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tools/zc0.c') diff --git a/src/tools/zc0.c b/src/tools/zc0.c index b0ab29f..ba5081d 100644 --- a/src/tools/zc0.c +++ b/src/tools/zc0.c @@ -1,9 +1,9 @@ /* zc0: stage 0 of the bootstrap. a small c compiler for the subset of zc that - compiler.zc is written in. it reads zc source on stdin and writes a genome + the compiler (src/compiler/) is written in. it reads zc source on stdin and writes a genome image (vm words placed at GORG, as little-endian 64-bit words) on stdout, in the same image layout the resident compiler's image mode produces. the cores embed that file with #embed (src/core/genome.h). no lifetime analysis, no quote, no - parse words, no block expressions: those only exist in compiler.zc. tags + parse words, no block expressions: those only exist in the compiler. tags (m, d, -> u) and casts (as u, as d) are parsed and recorded in signatures but not checked. */ #include @@ -341,7 +341,7 @@ static int64_t cexpr(void) /* ---- types ---- zc0 has no types: a type is read and thrown away. all it has to know is the shape, so that T[n] still reserves n words and the rest reserve one. the - grammar is the compiler's own (see ptype in compiler.zc): + grammar is the compiler's own (see ptype in src/compiler/types.zc): ptype a type, then any number of (params): int(int, int) is a function type ptype0 a type with its stars: int*, vec*, point** ptype1 a base: T[n], T[?], fixed T[?], fn, a name, or a generic instance -- cgit v1.2.3