POV-Ray : Newsgroups : povray.general : #declare really is anxious about its semicolon : #declare really is anxious about its semicolon Server Time
23 Apr 2024 20:20:44 EDT (-0400)
  #declare really is anxious about its semicolon  
From: Ard
Date: 7 Oct 2017 05:10:01
Message: <web.59d898b6dd6c5614a6573c40@news.povray.org>
Greetings, all.  I do not know whether this is a misbehaviour, so I shall post
about it here rather than in the bugs group.

The following line fails to parse, with "All #declares of [etc] require
semi-colon ';' at end if the language version is set to 3.5 or higher".

  #local A = #if (1) 123 #end ;

If you shift the semicolon to before the #end, it's good.  Or, this:

  #local A = #if (1) 123+ #end 0 ;

The example here is trivial of course but in my case the "123" was actually a
vector coming out of the mother of all macros, so finding the root cause took
some head-scratching.

I can see why it happens:  POV is attempting to prevent the parser from diving
into the rabbit hole when the semicolon truly is missing.

(I just noticed that the error message could use a polish-up too, depending on
how fussy you are about English.)

Maybe it will help others who find themselves in the same jam.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.