(block)
| 751 | //----------------------------------------------------------- |
| 752 | |
| 753 | export 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 | |
| 784 | export function buildDoc(parsedDoc) { |
| 785 | let blocks = []; |
no test coverage detected