classes inside functions?!
kellywilson at nowhere.com
kellywilson at nowhere.com
Sun Apr 30 03:18:59 PDT 2006
Hey guys,
My parser (based on 0.149) allows the first example and rejects the second. Thus
the grammar that I have seems to confirm what Sean has said, as well.
If anyone wants a copy of the pre-release (based on the Elkhound GLR parser
generator) then just email me at:
wilsonk-at-cpsc-dot-ucalgary-dot-ca
Thanks,
Kelly Wilson
P.S. Ivan (or BCS), if you want an update then please email (I have fixed about
7 or 8 problems from the original...though there are still some minor things to
clean up).
In article <e321m5$100h$1 at digitaldaemon.com>, Sean Kelly says...
>
>Hasan Aljudy wrote:
>> I don't know if this is a bug or what, but for some reason, dmd allows
>> you to define classes/structs/unions/enums as statements inside function
>> bodies.
>> Oddly enough, you cannot define a template in the same way
>>
>> I didn't find in the docs any mention of whether aggregates are allowed
>> inside function bodies or not.
>>
>> Walter, is this the correct behaviour?
>
>It is. Templates are merely a special case as they must have external
>linkage.
>
>
>Sean
More information about the Digitalmars-d
mailing list