MCPcopy Index your code
hub / github.com/gpujs/gpu.js / astBlockStatement

Method astBlockStatement

src/backend/web-gl/function-node.js:793–808  ·  view source on GitHub ↗

* @desc Parses the abstract syntax tree for *Block* statement * @param {Object} bNode - the AST object to parse * @param {Array} retArr - return array string * @returns {Array} the append retArr

(bNode, retArr)

Source from the content-addressed store, hash-verified

791 * @returns {Array} the append retArr
792 */
793 astBlockStatement(bNode, retArr) {
794 if (this.isState('loop-body')) {
795 this.pushState('block-body'); // this prevents recursive removal of braces
796 for (let i = 0; i < bNode.body.length; i++) {
797 this.astGeneric(bNode.body[i], retArr);
798 }
799 this.popState('block-body');
800 } else {
801 retArr.push('{\n');
802 for (let i = 0; i < bNode.body.length; i++) {
803 this.astGeneric(bNode.body[i], retArr);
804 }
805 retArr.push('}\n');
806 }
807 return retArr;
808 }
809
810 /**
811 * @desc Parses the abstract syntax tree for *Variable Declaration*

Callers

nothing calls this directly

Calls 4

astGenericMethod · 0.80
isStateMethod · 0.45
pushStateMethod · 0.45
popStateMethod · 0.45

Tested by

no test coverage detected