POV-Ray : Newsgroups : povray.beta-test : Parse error: macro tolerates jibberish but not incomplete scene code : Parse error: macro tolerates jibberish but not incomplete scene code Server Time
29 Jul 2024 10:18:21 EDT (-0400)
  Parse error: macro tolerates jibberish but not incomplete scene code  
From: Greg M  Johnson
Date: 22 May 2002 09:54:06
Message: <3ceba2fe$1@news.povray.org>
I) The code as pasted below bombs out at line 12 with the following:
>> sphere {0,0.5, <----ERROR
>> Parse Error: No matching } in 'sphere', ,  found instead

II) But if I uncomment out the shwang jibbersih, the error is instead
>> shwang <----ERROR
>> Parse Error: Need at least one component in a blob.

Case II) is expected:  it fits in with my understanding of a #macro as
something that just throws text out there.
Case I) is troublesome. It's like the parser says, "If it's jibberish, I'll
treat #macro as a text copy & paste routine; but I'll also take a peek at it
and parse it ****now**** if it looks povvish." )



#declare iter=3;
#declare scal=0.5;
#declare AH=.20;
#declare set=box{-0.5,0.5 rotate <45,0,45> }
#macro set1()
        //lala
         sphere {0,0.5,1
        //shwang {0,0,0}
#end
#macro rec(n)
 #if(n>0)
         rec(n-1) }
  rec(n-1) scale scal translate < AH, AH, AH>}
  rec(n-1) scale scal translate < AH, AH,-AH>}
  rec(n-1) scale scal translate < AH,-AH, AH>}
  rec(n-1) scale scal translate <-AH, AH, AH>}
  rec(n-1) scale scal translate < AH,-AH,-AH>}
  rec(n-1) scale scal translate <-AH,-AH, AH>}
  rec(n-1) scale scal translate <-AH, AH,-AH>}
  rec(n-1) scale scal translate <-AH,-AH,-AH>}
 #else
  set1() }
 #end
#end
//blob{   threshold 0.5 rec(iter) pigment{color rgb <0.9,0.1,0.3>}}


Post a reply to this message

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