|
|
Le 30/12/2014 01:01, Thorsten Froehlich a écrit :
> Warp <war### [at] tagpovrayorg> wrote:
>> Thorsten Froehlich <nomail@nomail> wrote:
>>> The place where it is used is the core part of the tokenizer. Using a
>>> dynamically allocated string would significantly increase overhead in the most
>>> called place as the short string optimization won't work (it is frequently not
>>> more than 10/14 chars). Now consider the average POV token length, and you
>>> notice
>>> you get at least one additional memory allocation per token parsed.
>>
>> Does the part that parses tokens really need to use the exact same string
>> class as the part that parses and handles strings?
>
> No, and actually, checking the code, this part of the tokenizer uses the unbound
> string parsing. Which leaves the question how the original poster could get this
> error message. The problem most likely is an identifier longer than 255
> characters ... which is, well, really pointless to have.
>
>
Sorry dear, but a string literal (e.g. "Povray is a nice program" in a
#declare or #local) longer than 255 would lead to a parse error with the
original parser.
Hence my patch in my master branch of hgpovray (made in May 2014).
I mean:
#declare MyString = "Povray is a nice program";
Now extends the string... and see povray fails to parse it when the
limit is reached.
--
Just because nobody complains does not mean all parachutes are perfect.
Post a reply to this message
|
|