MCPcopy Index your code
hub / github.com/witheve/Eve / buildBlock

Function buildBlock

src/runtime/builder.ts:753–782  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

751//-----------------------------------------------------------
752
753export function buildBlock(block) {
754 let context = new BuilderContext(block);
755 let {strata, binds, commits} = buildStrata(block, context);
756
757 // console.log("-- scans ----------------------------------------------------------------");
758 // console.log(inspect(scans, {colors: true, depth: 10}));
759
760 // console.log("-- binds ----------------------------------------------------------------");
761 // console.log(inspect(binds, {colors: true}));
762
763 // console.log("-- commits --------------------------------------------------------------");
764 // console.log(inspect(commits, {colors: true}));
765
766 let ix = 0;
767 for(let unprovided of context.unprovided) {
768 let vars = context.registerToVars[ix].map((varName) => block.variableLookup[varName]);
769 if(unprovided) {
770 context.errors.push(errors.unprovidedVariableGroup(block, vars));
771 }
772 for(let variable of vars) {
773 variable.register = ix;
774 }
775 ix++;
776 }
777
778 return {
779 block: new Block(block.name || "Unnamed block", strata, commits, binds, block),
780 errors: context.errors,
781 };
782}
783
784export function buildDoc(parsedDoc) {
785 let blocks = [];

Callers 1

buildDocFunction · 0.85

Calls 1

buildStrataFunction · 0.85

Tested by

no test coverage detected