Curious lack of error message

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Curious lack of error message

David Goodenough
I made a typo, and openscad reported only that there were no
top level objects to work with.  The type was:-

use <file.scad);

In other workds I used a ) not a >.  I presume that the parser
simply ran to the end of the file looking for a > and did not find one.

I would have expected a syntax error in that the use statement
effectively never finishes.

David

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

Giles Bathgate-2
You would have to be careful how you fix this, it should probably
allow multi line use statements so the error condition is when it has
an EOF token before a closing > e.g:

use <this
is not);
a)
syntax);
error
>
EOF

use <this
is)
a;
syntax);
error

EOF

Regards

Giles

On 16 July 2012 10:49, David Goodenough
<[hidden email]> wrote:

> I made a typo, and openscad reported only that there were no
> top level objects to work with.  The type was:-
>
> use <file.scad);
>
> In other workds I used a ) not a >.  I presume that the parser
> simply ran to the end of the file looking for a > and did not find one.
>
> I would have expected a syntax error in that the use statement
> effectively never finishes.
>
> David
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

nophead
Why would you ever want to have new lines in a file path?

On 16 July 2012 11:07, Giles Bathgate <[hidden email]> wrote:
You would have to be careful how you fix this, it should probably
allow multi line use statements so the error condition is when it has
an EOF token before a closing > e.g:

use <this
is not);
a)
syntax);
error
>
EOF

use <this
is)
a;
syntax);
error

EOF

Regards

Giles

On 16 July 2012 10:49, David Goodenough
<[hidden email]> wrote:
> I made a typo, and openscad reported only that there were no
> top level objects to work with.  The type was:-
>
> use <file.scad);
>
> In other workds I used a ) not a >.  I presume that the parser
> simply ran to the end of the file looking for a > and did not find one.
>
> I would have expected a syntax error in that the use statement
> effectively never finishes.
>
> David
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

Giles Bathgate-2

Yeah good point.

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

Len Trigg
While we are on the subject of error messages, another thing I have
noticed is that when you have a syntax error in your file but have
previously done an include, the line number associated with the error
includes the length of the included file, which makes finding the
actual location of the error quite difficult. It would make much more
sense if the line number stayed relative to the file in which the
error occurred (I use an external editor - maybe the built-in one
corrects for this).

Cheers,
Len.

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

nophead
I think this used to work but got broken recently. Also the editor used to highlight the line with the error but it doesn't seem to any more.

It is very difficult to find syntax errors in a large multi-file project like Mendel90. I have to do a binary chop by putting a deliberate error in to see id it is before or after.

On 16 July 2012 22:15, Len Trigg <[hidden email]> wrote:
While we are on the subject of error messages, another thing I have
noticed is that when you have a syntax error in your file but have
previously done an include, the line number associated with the error
includes the length of the included file, which makes finding the
actual location of the error quite difficult. It would make much more
sense if the line number stayed relative to the file in which the
error occurred (I use an external editor - maybe the built-in one
corrects for this).

Cheers,
Len.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

Reply | Threaded
Open this post in threaded view
|

Re: Curious lack of error message

Peter Falke
Yup, thats the way we used to work 30 years ago.
Back to the basics.

(This is not ment to belittle the programmers of OpenScad, no: thanks to you guys for all the good work. Just remembering ... )

TakeItAndRun

On 16 July 2012 23:26, nop head <[hidden email]> wrote:
I think this used to work but got broken recently. Also the editor used to highlight the line with the error but it doesn't seem to any more.

It is very difficult to find syntax errors in a large multi-file project like Mendel90. I have to do a binary chop by putting a deliberate error in to see id it is before or after.


On 16 July 2012 22:15, Len Trigg <[hidden email]> wrote:
While we are on the subject of error messages, another thing I have
noticed is that when you have a syntax error in your file but have
previously done an include, the line number associated with the error
includes the length of the included file, which makes finding the
actual location of the error quite difficult. It would make much more
sense if the line number stayed relative to the file in which the
error occurred (I use an external editor - maybe the built-in one
corrects for this).

Cheers,
Len.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!