Error: unexpected at line 26
at Array.unexpected (/Users/gre/Desktop/node_modules/glsl-parser/lib/index.js:637:26)
at /Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:264:36
at Object.original_symbol.nud (/Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:7:95)
at expression (/Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:156:12)
at Object.sym.led (/Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:168:28)
at expression (/Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:160:14)
at module.exports (/Users/gre/Desktop/node_modules/glsl-parser/lib/expr.js:116:12)
at parseexpr (/Users/gre/Desktop/node_modules/glsl-parser/lib/index.js:587:14)
at parse_expr (/Users/gre/Desktop/node_modules/glsl-parser/lib/index.js:565:14)
at Stream.write (/Users/gre/Desktop/node_modules/glsl-parser/lib/index.js:181:18)
I first experimented the bug on glsl.io, then I was able to reproduce it from NodeJS with:
var tokenizer = require('glsl-tokenizer')(), fs=require("fs"), parser=require("glsl-parser")
fs.createReadStream('test.glsl').pipe(tokenizer).pipe(parser()).on('data', function (x) { console.log(x); })
This GLSL line of code compiles, but is not parsed by glsl-parser
I first experimented the bug on glsl.io, then I was able to reproduce it from NodeJS with:
Also it works if you put a space before the
||