POV-Ray : Newsgroups : povray.bugreports : Possible error of nested #if inside #macro Server Time
30 Dec 2024 12:43:53 EST (-0500)
  Possible error of nested #if inside #macro (Message 1 to 3 of 3)  
From: BH
Subject: Possible error of nested #if inside #macro
Date: 10 Jun 2014 02:50:01
Message: <web.5396a9a2fecb1201f9bb8ced0@news.povray.org>
This is a report on a possible error of nested #if~#end inside #macro~#end.

The rendering using following code was found to be failed.
An error message, "line 5: Parse Error: All #declares of float, vector, and
color require semi-colon ';' at end if the language version is set to 3.5 or
higher. Either add the semi-colon or set the language version to 3.1 or lower.",
was obtained.

// ------------------------------------------------------------------------
#version 3.7;

#macro bb ()
    #if (1)
        0.0
    #end
#end

sphere{<0.0, 0.0, 0.0>,1.0 pigment{color <1,0,0>}}

#declare aa = 1.0 + bb ();

#if (1)
    #declare cc = <0.0, 0.0, 0.0>;
#end
// ------------------------------------------------------------------------


However, when I used next code, the rendering was succeeded correctly.  The
nested #if~#end inside #macro~#end has been removed using comment out in the
revised next code.
I confirmed following. As you see, the later #if~#end, which is NOT nested in
the other conditional directives such as #macro~#end, was processed
successfully.  Therefore, this may be an error only in the nested #if~#end
inside #macro~#end.


// ------------------------------------------------------------------------
#version 3.7;

#macro bb ()
    //  #if (1)
        0.0
    //  #end
#end

sphere{<0.0, 0.0, 0.0>,1.0 pigment{color <1,0,0>}}

#declare aa = 1.0 + bb ();

#if (1)
    #declare cc = <0.0, 0.0, 0.0>;
#end
// ------------------------------------------------------------------------

POV-Ray's version in this renderings is 3.7.0.msvc10.win64, runnning on Windows
8.1 Pro (64 bits, language: Japanese).
That's all this report on a possible error.

Sorry for poor at English.  Sincerely


Post a reply to this message

From: clipka
Subject: Re: Possible error of nested #if inside #macro
Date: 10 Jun 2014 06:05:16
Message: <5396d85c$1@news.povray.org>
Am 10.06.2014 08:47, schrieb BH:
> This is a report on a possible error of nested #if~#end inside #macro~#end.
>
> The rendering using following code was found to be failed.
> An error message, "line 5: Parse Error: All #declares of float, vector, and
> color require semi-colon ';' at end if the language version is set to 3.5 or
> higher. Either add the semi-colon or set the language version to 3.1 or lower.",
> was obtained.

Not really an error, just a quirk of the language. The following should 
work:

     #macro bb ()
       #if (1)
         #local result = 0.0;
       #end
       result
     #end


Post a reply to this message

From: BH
Subject: Re: Possible error of nested #if inside #macro
Date: 12 Jun 2014 08:50:00
Message: <web.5399a0ed5065b3d7f9bb8ced0@news.povray.org>
Thank you for your rapid reply.

I have obtained proper images by the renderings using the revised codes, which
were written on the basis of your code.  I have also confirmed that they did not
give any error on my PC environment.

I would like to express my gratitude to your advice that also made my works
proceed.
  Best regards.


Post a reply to this message

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