File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -317,15 +317,22 @@ GLSL.prototype.transforms = {
317
317
318
318
//arg names
319
319
var argsList = flatten ( args . map ( function ( arg ) {
320
- assert . equal ( arg . type , 'decl' , 'Struct statements should be declarations.' )
320
+ if ( arg . type !== 'decl' ) throw Error ( 'Struct statements should be declarations.' )
321
321
322
322
var decllist = arg . children [ arg . children . length - 1 ]
323
323
324
- assert . equal ( decllist . type , 'decllist' , 'Struct statement declaration has wrong structure.' )
324
+ if ( decllist . type !== 'decllist' ) throw Error ( 'Struct statement declaration has wrong structure.' )
325
325
326
- return decllist . children . map ( function ( ident ) {
327
- assert . equal ( ident . type , 'ident' , 'Struct statement contains something other than just identifiers.' )
328
- return ident . data
326
+ return decllist . children . map ( function ( node ) {
327
+ // { vec3 direction; }
328
+ if ( node . type === 'ident' ) return node . data
329
+
330
+ // { vec3 data[2]; }
331
+ if ( node . type === 'quantifier' ) {
332
+ console . log ( node )
333
+ }
334
+
335
+ throw Error ( 'Struct statement contains something strange.' )
329
336
} )
330
337
} ) )
331
338
Original file line number Diff line number Diff line change @@ -57,3 +57,16 @@ test('Anonymous', function (t) {
57
57
58
58
t . end ( )
59
59
} ) ;
60
+
61
+ // FIXME
62
+ test . skip ( 'Quantifier' , function ( t ) {
63
+ t . equal (
64
+ clean ( compile ( `struct Samples { sampler2D data[2]; };` ) ) ,
65
+ clean ( `
66
+ var Samples = {
67
+ direction: [0, 0, 0]
68
+ };` )
69
+ ) ;
70
+
71
+ t . end ( )
72
+ } )
You can’t perform that action at this time.
0 commit comments