Deprecate C style declerations?
Bill Baxter
dnewsgroup at billbaxter.com
Fri Dec 22 04:23:43 PST 2006
Jarrett Billingsley wrote:
> "Thomas Kuehne" <thomas-dloop at kuehne.cn> wrote in message
> news:slrneokpko.mj5.thomas-dloop at birke.kuehne.cn...
>
>> How about "pragma(line, ...);" ?
>
> Much nicer looking, but unfortunately, there's a problem with it. Pragmas
> are not considered until after the lexical pass, and that's what the #line
> directive affects. Basically the lexer would have to know about pragmas and
> be able to syntax and semantic them partially, breaking the separation
> between the passes. The current syntax has the advantage of meaning
> absolutely nothing after the lexical pass completes.
>
> Furthermore, pragmas can only legally appear where declarations would.
> #line can appear anywhere, even in the middle of a line.
>
> But I agree that it's a waste of # :)
>
>
It is a waste. So pragma's doen't work. I also hesitate to make some
notation in a comment suddenly have some effect. Maybe just make the
sigil be sequence of symbols rather than a single one?
:#line 6 "foo\bar"
/#line 6 "fool\bar"
##line 6 "foo\bar"
##{{line 6 "foo\bar"}}
##/line
Or what about #pragma(line, ...)
--bb
More information about the Digitalmars-d
mailing list