POV-Ray : Newsgroups : povray.bugreports : 3.8 macro parsing errors : Re: 3.8 macro parsing errors Server Time
19 Jul 2024 23:37:48 EDT (-0400)
  Re: 3.8 macro parsing errors  
From: William F Pokorny
Date: 20 Jun 2024 23:14:32
Message: <6674f018$1@news.povray.org>
On 6/20/24 19:49, Bald Eagle wrote:
> Can anyone confirm?
> debug?

I see a few things.

The yuqk fork complains about the line with the comment "// end macro 
Gamma" and there being a missing semicolon somewhere prior, but in this 
case the error is somewhat miss-leading.

The parser is unhappy because that line isn't the end of the macro, but 
of an #if directive. The '#end' line following is the end of the macro.


         #end // end macro Gamma

Those lines should be:

#end // end macro Gamma

2) Also in macro Gamma it looks possible by logic to go all the way 
through that macro and not ever set Result. So my strong recommendation 
would be to immediately set a default local 'Result' value at the top of 
Gamma(), but I don't know what it should be.

3) Also in macro Gamma you have:

      #if (X <= 0.0)
         #warning concat ("Invalid input argument ", str (X, 0, 4),
		". Argument must be positive. \n")

But, seems like that needs to be an #error as your not handling Result 
on the #break. You could not do that check at all then below cheat 
around some potential divisions by zero by adding fudge factors but I 
have no immediate idea what this means for the validity of any result.

     #if (X < 0.001)
         #local Result = 1.0/((X*(1.0 + _gamma*X))+1e-6);


     #local Result = Result / ((Y-1.0) + 1e-6);

4) The following line needs a semicolon:

#local Test = Gamma (0.5)

5) In TestGamma() you have the line:

#local computed = Gamma (test[T][0])

which needs a semicolon.

I hope of some help.

Bill P.

Post a reply to this message

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