pike complain "Unexpected end of file" when using #line in macro call

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

pike complain "Unexpected end of file" when using #line in macro call

郭雪松-2
[root@brain brain4]$cat t.pike #define A(a) class T{a};
A(class aa{
#line 2
                int n;
                });
void main()
{
        T();
}
[root@brain brain4]$pike t.pike
t.pike:6:Missing '}'.
t.pike:6:Unexpected end of file.
t.pike:6:Missing '}'.
t.pike:6:Unexpected end of file.
Pike: Failed to compile script.


Guo Xuesong
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: pike complain "Unexpected end of file" when using #line in macro call

Chris Angelico
2012/1/27 郭雪松 <[hidden email]>:

> [root@brain brain4]$cat t.pike
> #define A(a) class T{a};
> A(class aa{
> #line 2
>                 int n;
>                 });
> void main()
> {
>         T();
> }

Confirmed on 7.8.352 on Windows and 7.9 latest-from-git on Linux;
seems to be an issue only if the #line is inside the #define
expansion.

ChrisA

Loading...