POV-Ray : Newsgroups : povray.bugreports : 3.8 macro parsing errors : Re: 3.8 macro parsing errors Server Time
19 Jul 2024 22:50:20 EDT (-0400)
  Re: 3.8 macro parsing errors  
From: Bald Eagle
Date: 21 Jun 2024 05:45:00
Message: <web.66754a7118d864b51f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> 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.
>
> 1)
>   Result
>
>          #end // end macro Gamma
> #end
>
> Those lines should be:
>
>          #end
>  Result
> #end // end macro Gamma

That's because I left that extra #end in there to just try to get it to run
without complaining about the initial "missing" #end statement.

The initial configuration was just:

  Result

#end // end macro Gamma


Then I just commented it out when I started version changing.

> 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.

Yes, I had that sort of idea in the back of my head after I converted to SDL,
but without being able to run it and test it, that hardly matters.  I'd get an
obvious Lvalue Rvalue error of some sort anyway.

> 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")
>          #break
>      #end
>
> 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.

It was an #error, but I needed to force further parsing.
:)

>
> 4) The following line needs a semicolon:
>
> #local Test = Gamma (0.5)

I removed that after I set v to 3.1 because the parser complained about it being
there

>
> 5) In TestGamma() you have the line:
>
> #local computed = Gamma (test[T][0])

Same as above.

Thanks for looking - I prob won't be able to start tearing my hair out again
until late tonight or tomorrow.

- BW


Post a reply to this message

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