POV-Ray : Newsgroups : povray.bugreports : array mixed crashes in parser : Re: array mixed crashes in parser Server Time
16 Apr 2024 11:02:18 EDT (-0400)
  Re: array mixed crashes in parser  
From: TreeLimb Jim
Date: 10 Jul 2019 23:05:01
Message: <web.5d26a6743c87cc69799a5f510@news.povray.org>
Using the files in scenes/language/arrays/ I extended each sample .pov file to
include a cursory extension of storing and accessing data in mixed arrays, a
dictionary, and a dictionary containing a mixed array. Just basic data types,
float, string, vector. Baseline worked fine, no problems.

//  Example Data structure snip from "array3 mixed dictionary.pov"
#declare MyDictionary = dictionary {
 .Digit:
  array mixed[4][10]
  {
    {<7,7,7>,6,7,0,2,1,6,5,5,0},
    {<1,1,1>,2,3,4,5,6,7,8,9,0},
    {<0,0,0>,9,8,7,6,5,4,3,2,1},
    {<1,1,1>,1,2,2,3,3,4,4,5,5}
  }
}
// Works!

One test scenario yet to be tested is to implement a multi-dimensional array,
partially initialized. Sounds similar to my problem.

OT Observation: Within a dictionary one can declare another dictionary

// Data structure snip [condensed] from my project
// Dictionary element representingthe
 .CustomCaps:  array[2] {
  dictionary  { // Upper
   ["1004.3"]: array[5]{ Blue, Green, Yellow, Black, Black } // Never shown
   ["1006.1"]: array[5]{ arpPink, Yellow, White, White, Red } // not a 1006
   ["1016" ]: array[5]{ Black, Black, Black, Black, Black } // Never shown
   ["1023.1"]: array[5]{ Blue, Green, Yellow, Black, Blue }
   ["1027.2"]: array[5]{ Orange, Orange, Green, Green, Red }
   ["1045" ]: array[5]{ Red, Red, Red, Green, Yellow } // PT
   }
  dictionary {  // Lower
   ["1004.3"]: array[5]{ Black, Yellow, Green, Red, White } // Never shown
   ["1006.1"]: array[5]{ Yellow, arpPink, arpPink, arpPink, arpPink } // custom
   ["1016" ]: array[5]{ Gray, Black, White, Black, Yellow } // Never shown
   ["1023.1"]: array[5]{ Yellow, Green, Blue, arpPink, Red }
   ["1027.1"]: array[5]{ White, White, White, Yellow, Yellow }
   ["1027.2"]: array[5]{ Orange, Orange, Green, Green, Red }

   }
  }
// This time implementing string labels, represents the colored slider caps for
a particular module

OT Observation: no message flagging when  .pov files used #version 3.7 or 3.8
and mixed arrays or dictionary implemented. No biggie, I used to test software.

Oh, and kudos for all those working on the parser. I'm trying to stay just an
end user.


Post a reply to this message

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