discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Another parser and syntax error

JB
Jordan Brown
Tue, Nov 19, 2024 4:08 PM

On 11/19/2024 2:41 AM, jm.audouy--- via Discuss wrote:

In a shortcut, include seems to accept ; !!!!

Nope.  Or not exactly.  Include doesn't notice, because the semicolon
isn't part of the include.  And then the semicolon is just an empty
statement.

Say we have ball.scad:

sphere(10);

and we have main.scad:

include <ball.scad>;
cube(10);

That's exactly equivalent to:

sphere(10);
;
cube(10);

and the empty statement is ignored.

On 11/19/2024 2:41 AM, jm.audouy--- via Discuss wrote: > > In a shortcut, include seems to accept ; !!!! > Nope.  Or not exactly.  Include doesn't notice, because the semicolon isn't part of the include.  And then the semicolon is just an empty statement. Say we have ball.scad: sphere(10); and we have main.scad: include <ball.scad>; cube(10); That's *exactly* equivalent to: sphere(10); ; cube(10); and the empty statement is ignored.