scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.18k stars 263 forks source link

OpenSCAD parser error due to assert.SCAD syntax #80

Closed DGiulietti closed 4 years ago

DGiulietti commented 4 years ago

Tried opening splitflap.scad and received error:

ERROR: Parser error in file "D:/Documents/Enrichment/Manufacturing/Flapboard/splitflap-master/3d/assert.scad", line 17: syntax error >

I noticed that the word "assert" in line 17 of splitflap.scad was green, indicating functionality. So I changed the file name to "asser.scad" and updated the code.

Still received the error. That's when I realized the error was for the assert.scad file.

Similar issue, line 17 is defining a module and "assert" was green. The compiler must have been expecting a semicolon at the end of the line. So I changed the module name to "asser" and everything opened fine.

Today is the first day I'm using openSCAD so I'm reluctant to post any code, in case I've royally fudged something, but I did want to share my findings.

The code of assert.scad is not actually asserting in line 17, correct? It's just defining a module? Either way, there appears to be some syntax error in line 17.

scottbez1 commented 4 years ago

Thanks for posting this! (and apologies for the very late response). You're absolutely right about what's happening. I'm guessing you're using a new version of OpenSCAD? When I wrote this code originally, there was no assert() syntax in OpenSCAD, so I ended up creating a hack to make it very obvious if some assertion failed - I defined an assert module that would render a large red cube (and dump a bunch of error messages in the console) if the condition equated to false. But it looks like there's official assert syntax now, and the name of my module is conflicting with that syntax. I'll go ahead and rename that to avoid the conflict.