POV-Ray : Newsgroups : povray.beta-test : semicolon not expected Server Time
30 Jul 2024 12:31:56 EDT (-0400)
  semicolon not expected (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From:
Subject: semicolon not expected
Date: 7 Jan 2002 02:21:17
Message: <jmii3uc9k44v8s2rrmqi9kv9fn7j71v6ss@4ax.com>
POV 3.5 b 9.icl on PII 233 128 MB with NT 4 Sp 6
POV 3.5 b 9.icl on PII 233 128 MB with Win 95 OSR2

below script causes parsing error
"Expected 'object or directive', ; found instead"

#macro Test1()          1      #end
#macro Test2() #if(yes) 2 #end #end

#local F=Test1()   // works
#local F=Test1();  // works
#local F=Test2()   // works
#local F=Test2();  // not

Any confirmation ?

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: semicolon not expected
Date: 7 Jan 2002 07:18:46
Message: <3c399226@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> below script causes parsing error
> "Expected 'object or directive', ; found instead"
>
> #macro Test1()          1      #end
> #macro Test2() #if(yes) 2 #end #end
>
> #local F=Test1()   // works
> #local F=Test1();  // works
> #local F=Test2()   // works
> #local F=Test2();  // not
>
> Any confirmation ?

Semicolons are listed as required after every #local, #declare and #version
with a float, vector or color value.  If you don't include the required
semicolon the problem is in your scene and the parser reports it as soon as
it is possible to report this.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: semicolon not expected
Date: 7 Jan 2002 07:30:24
Message: <s35j3us07nout2lghojdb674e6bjbl3eeo@4ax.com>
On Mon, 07 Jan 2002 13:18:44 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Semicolons are listed as required after every #local, #declare and #version
> with a float, vector or color value.  If you don't include the required
> semicolon the problem is in your scene and the parser reports it as soon as
> it is possible to report this.

I think you misunderstand my report so I post shorter example:

#macro Test2() #if(yes) 2 #end #end
#local F=Test2();

note: there is semicolon but parser expects object or directive

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: semicolon not expected
Date: 7 Jan 2002 07:41:15
Message: <3c39976b$1@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> I think you misunderstand my report so I post shorter example:
>
> #macro Test2() #if(yes) 2 #end #end
> #local F=Test2();
>
> note: there is semicolon but parser expects object or directive

Indeed, I agree that this should work.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: semicolon not expected
Date: 7 Jan 2002 09:00:15
Message: <3c39a9ef@news.povray.org>

: #macro Test2() #if(yes) 2 #end #end
: #local F=Test2();

  Isn't the "right way" of returning values from a macro something like:

#macro Test2() #if(yes) #local res=2; #end res #end

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: semicolon not expected
Date: 7 Jan 2002 10:47:00
Message: <3c39c2f4@news.povray.org>
In article <3c39a9ef@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   Isn't the "right way" of returning values from a macro something like:
>
> #macro Test2() #if(yes) #local res=2; #end res #end

Hmm, what do the docs say about this?  Maybe it should be made clear that
only data appearing in the macro block itself is considered a return
value...

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: semicolon not expected
Date: 7 Jan 2002 10:51:20
Message: <5tgj3u8clfje8f8pialrkg9oesbfirv7d7@4ax.com>
On Mon, 07 Jan 2002 16:46:55 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Hmm, what do the docs say about this?  Maybe it should be made clear that
> only data appearing in the macro block itself is considered a return
> value...

6.2.8.3

ABX


Post a reply to this message

From: John VanSickle
Subject: Re: semicolon not expected
Date: 7 Jan 2002 13:54:43
Message: <3C39EFF8.C144AAFF@hotmail.com>
Thorsten Froehlich wrote:
> 

> ABX
> Skiba <abx### [at] babilonorg>  wrote:
> 
> > I think you misunderstand my report so I post shorter example:
> >
> > #macro Test2() #if(yes) 2 #end #end
> > #local F=Test2();
> >
> > note: there is semicolon but parser expects object or directive
> 
> Indeed, I agree that this should work.

The problem appears under 3.1g as well, with the same fix as is
given elsewhere in this thread.

-- 
ICQ: 46085459


Post a reply to this message

From: Rune
Subject: Re: semicolon not expected
Date: 7 Jan 2002 14:39:18
Message: <3c39f966@news.povray.org>
"Thorsten Froehlich" wrote:
> Hmm, what do the docs say about this?  Maybe it should
> be made clear that only data appearing in the macro
> block itself is considered a return value...

It doesn't have anything to do with macros at all, as this also generates an
error:

#declare C = #if(1) 1 #else 2 #end ;

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 2)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Christopher James Huff
Subject: Re: semicolon not expected
Date: 7 Jan 2002 17:10:53
Message: <chrishuff-99EEE5.17113807012002@netplex.aussie.org>
In article <3c39f966@news.povray.org>,
 "Rune" <run### [at] mobilixnetdk> wrote:

> It doesn't have anything to do with macros at all, as this also generates an
> error:
> 
> #declare C = #if(1) 1 #else 2 #end ;

If you wrap the conditional in parentheses, it will work fine:

#declare C = (#if(1) 1 #else 2 #end);

#macro Test2() (#if(yes) 2 #end) #end
#local F = Test2();

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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