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. --- tests/drivers/core_lsp_test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/drivers/core_lsp_test.js') diff --git a/tests/drivers/core_lsp_test.js b/tests/drivers/core_lsp_test.js index c3c01aa..5123537 100644 --- a/tests/drivers/core_lsp_test.js +++ b/tests/drivers/core_lsp_test.js @@ -6,6 +6,8 @@ const fs = require('fs'); const cp = require('child_process'); const path = require('path'); const target = process.argv[2]; +// the compiler is the files listed in src/compiler/parts; the server checks them as the one document they make +const compilerSource = () => fs.readFileSync('src/compiler/parts', 'utf8').split(/\r?\n/).filter(Boolean).map(n => fs.readFileSync(path.join('src/compiler', n), 'utf8')).join(''); const files = ['src/core/core.zc', 'src/runtime/rt.zc', 'src/compiler/compiler.zc', 'src/runtime/run.zc', 'src/lib/std.zc', 'src/lib/icon.zc', 'src/lsp/server.zc', 'src/tools/build.zc']; const frame = message => { const body = Buffer.from(JSON.stringify(message)); @@ -13,7 +15,7 @@ const frame = message => { }; for (const file of files) { const uri = 'file://' + path.resolve(file); - const text = fs.readFileSync(file, 'utf8'); + const text = file === 'src/compiler/compiler.zc' ? compilerSource() : fs.readFileSync(file, 'utf8'); const messages = [ { jsonrpc: '2.0', id: 1, method: 'initialize', params: {} }, { jsonrpc: '2.0', method: 'initialized', params: {} }, -- cgit v1.2.3