stackgl / shader-school

:mortar_board: A workshopper for GLSL shaders and graphics programming
Other
4.27k stars 252 forks source link

vert-1 crashing #176

Open keenanwoodall opened 4 years ago

keenanwoodall commented 4 years ago

I was working on vert-1 and it stopped recompiling when I'd save. I refreshed the browser (Chrome) and the following error was shown on screen and logged to the command line. I'm using vs code as my text editor fwiw. I restarted shader-school but the error returned immediately. Finally, I deleted the shader file and repopulated the directory. That seems to have fixed it

Error: did not use all tokens while parsing file: C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\exercises\vert-1\index.js at module.exports (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glslify-stream\node_modules\glsl-parser\lib\expr.js:121:11) at parseexpr (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glslify-stream\node_modules\glsl-parser\lib\index.js:595:9) at parse_expr (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glslify-stream\node_modules\glsl-parser\lib\index.js:572:14) at Stream.write (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glslify-stream\node_modules\glsl-parser\lib\index.js:182:18) at Stream.stream.write (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glslify-stream\node_modules\glsl-parser\node_modules\through\index.js:26:11) at Stream.ondata (internal/streams/legacy.js:17:31) at Stream.emit (events.js:223:5) at drain (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\through\index.js:36:16) at Stream.stream.queue.stream.push (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\through\index.js:45:5) at token (C:\Users\Keenan Woodall\AppData\Roaming\npm\node_modules\shader-school\node_modules\glsl-tokenizer\index.js:61:14)

disambiguator commented 3 years ago

I had this same issue. Turns out it was because I copy pasted some code from the internet which used a different character for -. I solved this by pasting my shader into this online linting tool to see the problem. https://evanw.github.io/glslx/