Skip to content

Commit e0388ab

Browse files
fix: File formatting from build
1 parent 2c8e4cf commit e0388ab

File tree

8 files changed

+71
-44
lines changed

8 files changed

+71
-44
lines changed

src/backend/function-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@ class FunctionBuilder {
305305

306306
module.exports = {
307307
FunctionBuilder
308-
};
308+
};

src/backend/function-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,4 +480,4 @@ class FunctionNode {
480480

481481
module.exports = {
482482
FunctionNode
483-
};
483+
};

src/backend/kernel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,4 +401,4 @@ class Kernel {
401401

402402
module.exports = {
403403
Kernel
404-
};
404+
};

src/backend/web-gl/function-node.js

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -819,30 +819,40 @@ class WebGLFunctionNode extends FunctionNode {
819819
return retArr;
820820
case 'this.output.value':
821821
switch (mNode.property.name) {
822-
case 'x': retArr.push(this.output[0]); break;
823-
case 'y': retArr.push(this.output[1]); break;
824-
case 'z': retArr.push(this.output[2]); break;
822+
case 'x':
823+
retArr.push(this.output[0]);
824+
break;
825+
case 'y':
826+
retArr.push(this.output[1]);
827+
break;
828+
case 'z':
829+
retArr.push(this.output[2]);
830+
break;
825831
}
826832
return retArr;
827-
case 'value': {
833+
case 'value':
834+
{
828835
throw this.astErrorOutput('Unexpected expression', mNode);
829836
}
830-
case 'value[]': {
837+
case 'value[]':
838+
{
831839
if (typeof mNode.object.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
832840
name = 'user_' + mNode.object.name;
833841
type = this.getVariableType(mNode.object.name);
834842
xProperty = mNode.property;
835843
break;
836844
}
837-
case 'value[][]': {
845+
case 'value[][]':
846+
{
838847
if (typeof mNode.object.object.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
839848
name = 'user_' + mNode.object.object.name;
840849
type = this.getVariableType(mNode.object.object.name);
841850
yProperty = mNode.object.property;
842851
xProperty = mNode.property;
843852
break;
844853
}
845-
case 'value[][][]': {
854+
case 'value[][][]':
855+
{
846856
if (typeof mNode.object.object.object.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
847857
name = 'user_' + mNode.object.object.object.name;
848858
type = this.getVariableType(mNode.object.object.object.name);
@@ -851,30 +861,41 @@ class WebGLFunctionNode extends FunctionNode {
851861
xProperty = mNode.property;
852862
break;
853863
}
854-
case 'value.value': {
855-
if (typeof mNode.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
856-
if (this.isAstMathVariable(mNode)) {
857-
retArr.push(Math[mNode.property.name]);
858-
return retArr;
859-
}
860-
switch (mNode.property.name) {
861-
case 'r': retArr.push(`user_${ mNode.object.name }.r`); return retArr;
862-
case 'g': retArr.push(`user_${ mNode.object.name }.g`); return retArr;
863-
case 'b': retArr.push(`user_${ mNode.object.name }.b`); return retArr;
864-
case 'a': retArr.push(`user_${ mNode.object.name }.a`); return retArr;
864+
case 'value.value':
865+
{
866+
if (typeof mNode.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
867+
if (this.isAstMathVariable(mNode)) {
868+
retArr.push(Math[mNode.property.name]);
869+
return retArr;
870+
}
871+
switch (mNode.property.name) {
872+
case 'r':
873+
retArr.push(`user_${ mNode.object.name }.r`);
874+
return retArr;
875+
case 'g':
876+
retArr.push(`user_${ mNode.object.name }.g`);
877+
return retArr;
878+
case 'b':
879+
retArr.push(`user_${ mNode.object.name }.b`);
880+
return retArr;
881+
case 'a':
882+
retArr.push(`user_${ mNode.object.name }.a`);
883+
return retArr;
884+
}
885+
break;
865886
}
866-
break;
867-
}
868-
case 'this.constants.value': {
869-
if (typeof mNode.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
870-
name = 'constants_' + mNode.property.name;
871-
type = this.getConstantType(mNode.property.name);
872-
if (!type) {
873-
throw this.astErrorOutput('Constant has no type', mNode);
887+
case 'this.constants.value':
888+
{
889+
if (typeof mNode.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
890+
name = 'constants_' + mNode.property.name;
891+
type = this.getConstantType(mNode.property.name);
892+
if (!type) {
893+
throw this.astErrorOutput('Constant has no type', mNode);
894+
}
895+
break;
874896
}
875-
break;
876-
}
877-
case 'this.constants.value[]': {
897+
case 'this.constants.value[]':
898+
{
878899
if (typeof mNode.object.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
879900
name = 'constants_' + mNode.object.property.name;
880901
type = this.getConstantType(mNode.object.property.name);
@@ -884,7 +905,8 @@ class WebGLFunctionNode extends FunctionNode {
884905
xProperty = mNode.property;
885906
break;
886907
}
887-
case 'this.constants.value[][]': {
908+
case 'this.constants.value[][]':
909+
{
888910
if (typeof mNode.object.object.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
889911
name = 'constants_' + mNode.object.object.property.name;
890912
type = this.getConstantType(mNode.object.object.property.name);
@@ -895,7 +917,8 @@ class WebGLFunctionNode extends FunctionNode {
895917
xProperty = mNode.property;
896918
break;
897919
}
898-
case 'this.constants.value[][][]': {
920+
case 'this.constants.value[][][]':
921+
{
899922
if (typeof mNode.object.object.object.property.name !== 'string') throw this.astErrorOutput('Unexpected expression', mNode);
900923
name = 'constants_' + mNode.object.object.object.property.name;
901924
type = this.getConstantType(mNode.object.object.object.property.name);
@@ -1345,8 +1368,8 @@ class WebGLFunctionNode extends FunctionNode {
13451368

13461369
getMemberExpressionPropertyMarkup(property) {
13471370
if (!property) {
1348-
throw new Error('Property not set');
1349-
}
1371+
throw new Error('Property not set');
1372+
}
13501373
const type = this.firstAvailableTypeFromAst(property);
13511374
const result = [];
13521375
if (type === 'Number') {
@@ -1396,4 +1419,4 @@ const typeLookupMap = {
13961419

13971420
module.exports = {
13981421
WebGLFunctionNode
1399-
};
1422+
};

src/backend/web-gl/kernel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,4 +1541,4 @@ class WebGLKernel extends GLKernel {
15411541

15421542
module.exports = {
15431543
WebGLKernel
1544-
};
1544+
};

src/backend/web-gl2/kernel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,4 +966,4 @@ class WebGL2Kernel extends WebGLKernel {
966966

967967
module.exports = {
968968
WebGL2Kernel
969-
};
969+
};

src/plugins/random-gold-noise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ module.exports = {
3838
functionReplace,
3939
functionReturnType,
4040
source
41-
};
41+
};

src/utils.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
const { Input } = require('./input');
2-
const { Texture } = require('./texture');
1+
const {
2+
Input
3+
} = require('./input');
4+
const {
5+
Texture
6+
} = require('./texture');
37

48
const FUNCTION_NAME = /function ([^(]*)/;
59
const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
@@ -234,7 +238,7 @@ const utils = {
234238
* @param {Array|*} array
235239
* @param {Float32Array|Float64Array} target
236240
*/
237-
flattenTo(array, target) {
241+
flattenTo(array, target) {
238242
if (utils.isArray(array[0])) {
239243
if (utils.isArray(array[0][0])) {
240244
utils.flatten3dArrayTo(array, target);
@@ -292,4 +296,4 @@ const _systemEndianness = utils.getSystemEndianness();
292296

293297
module.exports = {
294298
utils
295-
};
299+
};

0 commit comments

Comments
 (0)