Hi all,
I'm learning OpenScad, and can't fix following error message:
Parsing design (AST generation)...
ERROR: Parser error: syntax error in file Tubes.scad, line 4
Replacing semi-colons, curly brackets, square brackets, and always the same message...
Googling a lot and not how to fix it.
Is there someone kind enough to tell me, where is the mistake?
Thanks a lot, and nice day.
jm
include <tube.scad>
No semicolon. Yes, that's confusing and I mess it up on a regular basis.
On Mon, Nov 18, 2024 at 8:23 PM jm.audouy--- via Discuss <
discuss@lists.openscad.org> wrote:
Hi all,
I'm learning OpenScad, and can't fix following error message:
Parsing design (AST generation)...
ERROR: Parser error: syntax error in file Tubes.scad, line 4
Replacing semi-colons, curly brackets, square brackets, and always the
same message...
Googling a lot and not how to fix it.
Is there someone kind enough to tell me, where is the mistake?
Thanks a lot, and nice day.
jm
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Something else that I am going to suggest, even though it is not directly related to your error, is to use a more advanced editor. I use Visual Studio Code with the OpenSCAD plugin. When using this (and probably most other editors), it helps you find the syntax errors faster, and for things like the include & use commands, show you the available sources (for example, tube.scad in your case) and add them simply by hitting the tab key. Hovering over custom modules & functions also shows you the parameters, and adding a comment line immediately before the declaration will let you give a description that you will see when hovering. OpenSCAD is great for previewing & rendering, but using an external editor for the code is something that has saved me a huge amount of time & majorly increased my productivity & efficiency. This is obviously your decision, but I do suggest taking it into consideration. Good luck!
Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com
From: Father Horton via Discuss discuss@lists.openscad.org
Sent: Monday, November 18, 2024 9:26 PM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: Father Horton fatherhorton@gmail.com
Subject: [OpenSCAD] Re: Another parser and syntax error
include <tube.scad>
No semicolon. Yes, that's confusing and I mess it up on a regular basis.
On Mon, Nov 18, 2024 at 8:23 PM jm.audouy--- via Discuss <discuss@lists.openscad.orgmailto:discuss@lists.openscad.org> wrote:
Hi all,
I'm learning OpenScad, and can't fix following error message:
Parsing design (AST generation)...
ERROR: Parser error: syntax error in file Tubes.scad, line 4
Replacing semi-colons, curly brackets, square brackets, and always the same message...
Googling a lot and not how to fix it.
Is there someone kind enough to tell me, where is the mistake?
Thanks a lot, and nice day.
jm
[cid:ii_193423dcb08c61b530f1]
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.orgmailto:discuss-leave@lists.openscad.org
On 11/18/2024 6:26 PM, Father Horton via Discuss wrote:
include <tube.scad>
No semicolon. Yes, that's confusing and I mess it up on a regular basis.
Perversely, it's not weird enough.
"include" is not a normal statement. The text of the file is included
in the program, as if it was typed there.
Have a comma-separated list of values that you need in an array?
array = [
include <commavalues.txt>
];
Have a value in a file that you need in a variable?
x = include <value.txt>;
Quick, exactly what does this do?
include = 5;
if (include < 10 && include > 3) cube();
There are only a very small number of places where include<> is not
recognized: inside a string, inside a comment, inside a larger
identifier, and inside the integer part of a number.
The behavior of the include<> construct is special enough that it would
really be better if it had some special marking, like #include does in
C. It should also only be recognized if on a line by itself; there's no
need for the obscure ways you can abuse it.
Its friend use<> is slightly less magic, but only slightly.
To be clear: I'm not saying that include<> behavior is good. Quite the
contrary, in fact. But if you expect it to be normal, you'll be
surprised and confused.
Hi Father Horton,
Thanks a lot for your help.
Nice day.
jm
Hi Father Horton,
Thanks a lot for your help.
Nice day.
jm
Hi Nathan,
Thanks a lot for your advice and help.
Nice day.
jm
Hi Jordan,
Thanks a lot for your help.
Nice day.
jm
Hi all,
As i never give up, i did numerous trials, and find the result…
In a shortcut, include seems to accept ; !!!!
If ; is missing doesn’t matter, it’s strange.
See screenshots .
Nice day, and thanks for your help in this forum.
jm
Hi Jordan,
You are right, missing < and> in this statement.
Nice day and thanks a lot.
jm