Hi,
My first time at your forum and also using OpenSCAD (Linux OS). I'm in
the WIKIBOOKS OpenSCAD Tutorial/Chapter 1, Creating you first object.
The code to enter is:
a_small_cube.scad
cube(size=10);
with the instructions to "hit the preview (first) icon on the action bar
below the reference axes."
Upon clicking the Preview Icon I get these error messages and the "s" in
the word cube.scad is highlighted red and the execution is aborted. I've
copied the lines and typed them in and get the same error. I've also
uninstalled and reinstalled OpenSCAD.
Loaded design '/home/david/scad/scad cube.scad'.
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1:
syntax error
Execution aborted
Parsing design (AST generation)...
Saved backup file: /home/david/.local/share/OpenSCAD/backups/scad
cube-backup-KySmaALE.scad
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1:
syntax error
Execution aborted
Any suggestions on how to resolve this?
Thanks,
Dmend
On 4/15/21 6:19 PM, Mendalski wrote:
a_small_cube.scad
cube(size=10);
You need to make the first line into a comment because it is not a
correct command on its own. The location of the highlight is not always
going to be helpful (though it will help if the command you have typed
is almost correct.
// a_small_cube.scad
cube(size=10)
remove a_small_cube.scad, it is the file name.
From: Mendalski [mailto:d58m@comcast.net]
Sent: Fri, 16 Apr 2021 08:20
To: discuss@lists.openscad.org
Subject: [OpenSCAD] Newbie with Parser Error Line 1
Hi,
My first time at your forum and also using OpenSCAD (Linux OS). I'm in the WIKIBOOKS OpenSCAD Tutorial/Chapter 1, Creating you first object.
The code to enter is:
a_small_cube.scad
cube(size=10);
with the instructions to "hit the preview (first) icon on the action bar below the reference axes."
Upon clicking the Preview Icon I get these error messages and the "s" in the word cube.scad is highlighted red and the execution is aborted. I've copied the lines and typed them in and get the same error. I've also uninstalled and reinstalled OpenSCAD.
Loaded design '/home/david/scad/scad cube.scad'.
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1: syntax error
Execution aborted
Parsing design (AST generation)...
Saved backup file: /home/david/.local/share/OpenSCAD/backups/scad cube-backup-KySmaALE.scad
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1: syntax error
Execution aborted
Any suggestions on how to resolve this?
Thanks,
Dmend
--
This email has been checked for viruses by AVG.
https://www.avg.com
That is wrong. It seems they have put in the file name, for some obscure
reason. Leave out the first line.
On 15/04/2021 23:19, Mendalski wrote:
WIKIBOOKS OpenSCAD Tutorial/Chapter 1,
Than you Ray, Michael, and Algot for your help. I will stick with the
PDF instructions you sent.
Dmend
On 4/15/21 5:19 PM, Mendalski wrote:
Hi,
My first time at your forum and also using OpenSCAD (Linux OS). I'm in
the WIKIBOOKS OpenSCAD Tutorial/Chapter 1, Creating you first object.
The code to enter is:
a_small_cube.scad
cube(size=10);
with the instructions to "hit the preview (first) icon on the action
bar below the reference axes."
Upon clicking the Preview Icon I get these error messages and the "s"
in the word cube.scad is highlighted red and the execution is aborted.
I've copied the lines and typed them in and get the same error. I've
also uninstalled and reinstalled OpenSCAD.
Loaded design '/home/david/scad/scad cube.scad'.
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1:
syntax error
Execution aborted
Parsing design (AST generation)...
Saved backup file: /home/david/.local/share/OpenSCAD/backups/scad
cube-backup-KySmaALE.scad
ERROR: Parser error in file "/home/david/scad/scad cube.scad", line 1:
syntax error
Execution aborted
Any suggestions on how to resolve this?
Thanks,
Dmend
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
[ This is a discussion of how the tutorial might be improved to avoid
this confusion. ]
On 4/15/2021 3:19 PM, Mendalski wrote:
The code to enter is:
a_small_cube.scad
cube(size=10);
This is indeed confusing. I went to go see if I could fix the tutorial,
but this pattern is used throughout so it's not a simple point fix.
Here's what it looks like:
Knowing the language and that there's an issue here, it's easy to see
that "a_small_cube.scad" is in italics, and the cube() invocation is in
a different font, in a box, but (a) files haven't been covered yet, (b)
the inner box is subtle, and (c) it's easy to miss the font change.
So what should it look like?
Maybe make the file name be more distinct?
Maybe move it into the title?
(But note the double box, which is kind of strange. The inner box is
how Wikibooks is styling <pre>.)
Wikipedia programming language samples look like
or
but do not have a title ("Code") or file name ("a_small_cube.scad").
Or something else?
My suggestion:
Any thoughts?
On 16.04.21 02:20, Jordan Brown wrote:
Maybe move it into the title?
I like that option best, it might be useful to have a file
name that could be matched (or even linked?) against a github
repo with all the files.
ciao,
Torsten.
On 4/17/2021 10:14 AM, Torsten Paul wrote:
On 16.04.21 02:20, Jordan Brown wrote:
Maybe move it into the title?
I like that option best, it might be useful to have a file
name that could be matched (or even linked?) against a github
repo with all the files.
Here's a structure that is in some ways convenient.
I created a template {{User:Jordan Brown/sandbox/tmpl}}. Its simplest
invocation is
{{User:Jordan Brown/sandbox/OpenSCADExample|name=a_small_cube}}
which generates:
You can see this live at
https://en.wikibooks.org/wiki/User:Jordan_Brown/sandbox/demo .
What it does, in this simple invocation, with a name FOO, is:
So the idea is that you put this simple reference into the main
document, and you create a page FOO with the OpenSCAD program, and an
image file FOO.jpg, and the template takes care of putting them together
into the preferred form.
I also put together a slightly different template OpenSCADExample2, that
produces this, which I like a little better:
... but I'm not entirely happy with the title format.
The tricky part of this is in getting it to transclude a page without
processing any wikitext on that page, so that the FOO page can contain
precisely the OpenSCAD program, without needing any protective markup.
The mechanism that I found, the "msgnw:" modifier, seems to work but
there are hints that there may be a few kinds of wikitext that will
still be processed.
Of course, this requires that the page containing the example, the
image, and the source file on github have the same name. That could be
viewed as a limitation, or it could be viewed as a feature encouraging
structure. The current implementation of the template allows for
specifying the name of the image separately, as img=BAR, and allows
specifying the content directly (instead of via another page) as
content=WHATEVER. There could be a similar override for the github
link, but isn't yet. The image type defaults to jpg, but can be
overridden with imgtype=XXX.
All of the details are easily changed, at least until we start using it.
Of course it would get put somewhere in the main template namespace, not
in my sandbox.
The key feature is that one template then controls the format of all
examples throughout the book.