porffor 0.37.12 → 0.37.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/compiler/2c.js CHANGED
@@ -213,7 +213,7 @@ export default ({ funcs, globals, tags, data, exceptions, pages }) => {
213
213
  }
214
214
 
215
215
  if (pages.size > 0) {
216
- prepend.set('_memory', `char _memory[${pages.size * pageSize}];\n`);
216
+ prepend.set('_memory', `static char _memory[${pages.size * pageSize}];\n`);
217
217
  if (Prefs['2cMemcpy']) includes.set('string.h', true);
218
218
  }
219
219
 
@@ -224,7 +224,7 @@ export default ({ funcs, globals, tags, data, exceptions, pages }) => {
224
224
  prependMain.set('_data', activeData.map(x => `memcpy(_memory + ${dataOffset(x)}, (unsigned char[]){${x.bytes.join(',')}}, ${x.bytes.length});`).join('\n '));
225
225
  includes.set('string.h', true);
226
226
  } else {
227
- prependMain.set('_data', activeData.map(x => x.bytes.reduce((acc, y, i) => acc + `_memory[${dataOffset(x) + i}]=(u8)${y};`, '')).join('\n '));
227
+ prependMain.set('_data', activeData.map(x => x.bytes.reduce((acc, y, i) => acc + (y === 0 ? '' : `_memory[${dataOffset(x) + i}]=(u8)${y};`), '')).join('\n '));
228
228
  }
229
229
  }
230
230
 
package/compiler/index.js CHANGED
@@ -256,7 +256,7 @@ export default (code, flags) => {
256
256
  if (logProgress) {
257
257
  const total = performance.now();
258
258
  progressClear();
259
- console.log(`\u001b[90m[${total.toFixed(0)}ms]\u001b[0m \u001b[92mcompiled ${globalThis.file} -> ${outFile}\u001b[0m`);
259
+ console.log(`\u001b[90m[${total.toFixed(0)}ms]\u001b[0m \u001b[32mcompiled ${globalThis.file} \u001b[90m->\u001b[0m \u001b[92m${outFile}\u001b[90m (${(fs.statSync(outFile).size / 1000).toFixed(1)}KB)\u001b[0m`);
260
260
  }
261
261
 
262
262
  process.exit();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.37.12+3c9b430f0",
4
+ "version": "0.37.13+08fb072a3",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.37.12+3c9b430f0';
3
+ globalThis.version = '0.37.13+08fb072a3';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {