refactor: extract coerce and stressorToString into util.js

This commit is contained in:
c0dev0id
2026-07-06 21:09:36 +02:00
parent 1ad4b73c9a
commit 9a2e76ba4f
5 changed files with 19 additions and 19 deletions

View File

@@ -1,5 +1,4 @@
// RFC-compliant YAML serializer for Sompyler instrument blocks.
// Operates on the model produced by ast-parser.js buildModel().
import { stressorToString } from './util.js';
// ── Shape ──────────────────────────────────────────────────────────────────
// RFC §1.3.4.5: SHAPE = [PREFIX (":" / ";")] Node 1*(";" Node)
@@ -241,10 +240,6 @@ function patchInstrumentHeader(text, instruments) {
return result.join('\n');
}
export function stressorToString(s) {
if (!s?.groups?.length) return '';
return s.groups.map(g => g.join(',')).join(';');
}
function patchBarMeta(doc, bar) {
const props = [];