POV-Ray : Newsgroups : povray.bugreports : alpha.10064268 undef behaviour : Re: alpha.10064268 undef behaviour Server Time
21 Sep 2021 07:12:56 EDT (-0400)
  Re: alpha.10064268 undef behaviour  
From: clipka
Date: 29 May 2021 14:04:34
Message: <60b28232$1@news.povray.org>
Am 13.08.2020 um 15:23 schrieb William F Pokorny:

> In symboltable.cpp Christoph added:
> 
> // TODO See captured issue:
> // jr_Parse_alpha_10064268_to_10064268_Aug13_2020
> //         POV_EXPERIMENTAL_ASSERT((ttype != FLOAT_TOKEN_CATEGORY) &&
> //                                 (ttype !=
FLOAT_ID_TOKEN) &&
> //                                 (ttype !=
VECTOR_TOKEN_CATEGORY) &&
> //                                 (ttype !=
COLOUR_TOKEN_CATEGORY));

Yeh, that's the offending statement; but...

> // I "think" Christoph wanted something like that below.
> // BUT! Why didn't he just differently order FLOAT_ID_TOKEN,
> // VECTOR_ID_TOKEN as he looks to have ordered COLOUR_ID_TOKEN
> // This looks like something not complete and certainly not clean.
> 
>          POV_EXPERIMENTAL_ASSERT(((ttype != FLOAT_TOKEN_CATEGORY) ||
>                                   (ttype ==
FLOAT_ID_TOKEN)) &&
>                                  ((ttype !=
VECTOR_TOKEN_CATEGORY) ||
>                                   (ttype ==
VECTOR_ID_TOKEN)) &&
>                                  (ttype !=
COLOUR_TOKEN_CATEGORY));

... that doesn't make any sense whatsoever, because `(ttype == 
FLOAT_ID_TOKEN)` can only hold true if `(ttype != FLOAT_TOKEN_CATEGORY)` 
is true anyway.

Nay, the answer is a different one. `(ttype != FLOAT_ID_TOKEN)` 
shouldn't have made it in there in the first place. Also, there's one 
*_CATEGORY value missing from the list, namely 
`SIGNATURE_TOKEN_CATEGORY`. Which for reasons of neatness should be the 
first in the list.

I'll commit a fix to the repo soon.


Post a reply to this message

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