aboutsummaryrefslogtreecommitdiff
path: root/tinyvm.bat
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 10:05:40 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 10:05:40 +0000
commitce920b6ff47f32bc06dd27124e1b882f82f3d6ae (patch)
tree89f3dac0aa670294053320599a742d670c0ec5a4 /tinyvm.bat
parenttodo: tick the parity runner; zc0 follow-ups it found (diff)
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.
Diffstat (limited to 'tinyvm.bat')
-rwxr-xr-xtinyvm.bat6
1 files changed, 3 insertions, 3 deletions
diff --git a/tinyvm.bat b/tinyvm.bat
index 7d0676d..2de5a0a 100755
--- a/tinyvm.bat
+++ b/tinyvm.bat
@@ -412,18 +412,18 @@ if errorlevel 1 exit /b 1
echo Bootstrapping the compiler genome...
if not exist build\s0 mkdir build\s0
if not exist build\s1 mkdir build\s1
-(type src\runtime\rt.zc & type src\core\core.zc & type src\compiler\compiler.zc) | build\bin\zc0.exe > build\s0\g0.bin
+(type src\runtime\rt.zc & type src\core\core.zc & for /f %%f in (src\compiler\parts) do @type src\compiler\%%f) | build\bin\zc0.exe > build\s0\g0.bin
if errorlevel 1 (echo [ERROR] Stage 0 failed.& exit /b 1)
build\bin\mkgenome.exe < build\s0\g0.bin > build\s0\genome.bin
if errorlevel 1 (echo [ERROR] Stage 0 did not produce a genome.& exit /b 1)
"%CC%" -O2 -w -fwrapv -DJTYPE=int src\core\core.c src\core\io_win.c -Isrc/core -Ibuild/core/map --embed-dir=build/s0 -o build\s0\zy0.exe
if errorlevel 1 (echo [ERROR] Failed to build the stage 0 core.& exit /b 1)
-(type src\tools\build.zc & echo ` & type src\runtime\rt.zc & type src\core\core.zc & type src\compiler\compiler.zc) | build\s0\zy0.exe > build\s1\g1.bin
+(type src\tools\build.zc & echo ` & type src\runtime\rt.zc & type src\core\core.zc & for /f %%f in (src\compiler\parts) do @type src\compiler\%%f) | build\s0\zy0.exe > build\s1\g1.bin
build\bin\mkgenome.exe < build\s1\g1.bin > build\s1\genome.bin
if errorlevel 1 (echo [ERROR] The compiler did not compile itself; its diagnostics are above.& exit /b 1)
"%CC%" -O2 -w -fwrapv -DJTYPE=int src\core\core.c src\core\io_win.c -Isrc/core -Ibuild/core/map --embed-dir=build/s1 -o build\s1\zy1.exe
if errorlevel 1 (echo [ERROR] Failed to build the stage 1 core.& exit /b 1)
-(type src\tools\build.zc & echo ` & type src\runtime\rt.zc & type src\core\core.zc & type src\compiler\compiler.zc) | build\s1\zy1.exe > build\s1\g2.bin
+(type src\tools\build.zc & echo ` & type src\runtime\rt.zc & type src\core\core.zc & for /f %%f in (src\compiler\parts) do @type src\compiler\%%f) | build\s1\zy1.exe > build\s1\g2.bin
fc /b build\s1\g1.bin build\s1\g2.bin >nul
if errorlevel 1 (echo [ERROR] Fixpoint failed: the compiler does not compile itself to the same image.& exit /b 1)
copy /y build\s1\genome.bin build\core\genome.bin >nul